Skip to content

Commit a295bc4

Browse files
authored
Merge branch 'master' into rockpaperscissors
2 parents 3806b2f + bf56c97 commit a295bc4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CLUE_Altimeter/clue_altimeter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
clue._pressure.standby_period = 0x01 # 62.5 ms
3131

3232
# restore saved sea level pressure from NVM
33-
clue.sea_level_pressure = struct.unpack("f", nvm[0:4])[0]
33+
slp = struct.unpack("f", nvm[0:4])[0]
34+
clue.sea_level_pressure = slp if 0 < slp < 2000 else STD_SLP
3435

3536
# --------------------------------------------------------------------
3637
# D I S P L A Y S E T U P

0 commit comments

Comments
 (0)