Mercurial > public > ostc4
comparison Small_CPU/Src/scheduler.c @ 310:95928ef3986f cleanup-4
Make dive mode detection more advanced
In commit a09b1855d656, a RTE function was factored out, that was
used to detect dive mode vs. surface mode.
In the hunt for the time difference bug between stopwatch and dive time
some progress was made, but its still not totally right. Add some old
logic back, that seems reasonable.
A pool test after this commit shows some improvement, but still there
is some random difference between stopwatch and dive time. Things like
perfectly in sync for 20 min. surface shortly, and descend again in
the same dive. Now, the was a 1 or 2 second difference.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Sun, 26 May 2019 10:09:22 +0200 |
parents | a09b1855d656 |
children | b4c578caaafb |
comparison
equal
deleted
inserted
replaced
309:b0045281cb2d | 310:95928ef3986f |
---|---|
1558 return 0xFFFFFFFF - ticksstart + ticksnow; | 1558 return 0xFFFFFFFF - ticksstart + ticksnow; |
1559 } | 1559 } |
1560 } | 1560 } |
1561 | 1561 |
1562 /* same as in data_central.c */ | 1562 /* same as in data_central.c */ |
1563 _Bool is_ambient_pressure_close_to_surface(SLifeData *lifeDataCall) | 1563 _Bool is_ambient_pressure_close_to_surface(SLifeData *lifeData) |
1564 { | 1564 { |
1565 if(lifeDataCall->pressure_ambient_bar < (lifeDataCall->pressure_surface_bar + 0.1f)) // hw 161121 now 1 mter, before 0.04f | 1565 if (lifeData->pressure_ambient_bar > 1.16) |
1566 return false; | |
1567 else if(lifeData->pressure_ambient_bar < (lifeData->pressure_surface_bar + 0.1f)) // hw 161121 now 1 mter, before 0.04f | |
1566 return true; | 1568 return true; |
1567 else | 1569 else |
1568 return false; | 1570 return false; |
1569 } | 1571 } |
1570 | 1572 |