Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/spbrgselect.inc @ 212:275befc5f39d
Debug GF model (bug #11 & #12).
+ ASSERT stops should be computed in order (bug#11).
+ BUGFIX: Mark GF_low reference at actual first stop, not predicted one.
+ BUGFIX: sim_to_first_stop() stops BEFORE first stop, not after (bug#11).
+ BUGFIX: check that calc_nextdecodepth() don't ascent faster than 10m/mn (bug#11).
+ BUGFIX: calc_nextdecodepth() should check gas switch, too (bug#11).
+ let gas switch detection in depth/meter (not ambientPresure/mbar).
+ BUGFIX OCR mode: bad diluent value in sim_alveolar_pressure() (bug#11).
+ BUGFIX: add deco distance (offset) only to compartiment integration, not to B?hlmann or GF criterion.
+ BUGFIX: add margin one meter above gas switch depth (bug#12)
+ BUGFIX: When ascenting too fast, cancel gas switch delay and history (bug#11).
author | JeanDo |
---|---|
date | Mon, 21 Feb 2011 22:36:48 +0100 |
parents | 96a35aeda5f2 |
children |
rev | line source |
---|---|
0 | 1 RoundResult SET 0 ; Rounding function. RoundResult = Round(aa/bb) |
2 Round macro aa,bb | |
3 LOCAL rr = aa/bb | |
4 LOCAL d1 = aa - rr*bb | |
5 LOCAL d2 = (rr+1)*bb - aa | |
6 RoundResult = rr | |
7 if d1 >= d2 | |
8 RoundResult++ | |
9 endif | |
10 endm | |
11 | |
12 AbsResult SET 0 | |
13 Abs macro nr | |
14 if nr>=0 | |
15 AbsResult = nr | |
16 else | |
17 AbsResult = -nr | |
18 endif | |
19 endm | |
20 | |
21 Round xtal,(16*baud) | |
22 spbrg_value EQU RoundResult-1 | |
23 | |
24 Round xtal,(16*(spbrg_value+1)) | |
25 baud_real EQU RoundResult | |
26 Abs(baud_real-baud) | |
27 errpercent EQU AbsResult*100/baud | |
28 if errpercent > 4 | |
29 ERROR big error in baudrate: #v(errpercent)% | |
30 endif | |
31 if errpercent >= 2 | |
32 messg baudrate not exact: #v(errpercent)% | |
33 endif |