Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Commit

Permalink
Mask out FCS bits from system connection byte
Browse files Browse the repository at this point in the history
In compliance with updated Cortex Flashing Specification.

Fixes #31 and issue raised by @BottomNotch
  • Loading branch information
edjubuh committed Mar 5, 2017
1 parent 21230ce commit 870d3be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prosflasher/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def ask_sys_info(port, ctx=proscli.utils.State(), silent=False):
if response[10] > 5: # anything smaller than 5 is probably garbage from ADC
sys_info.backup_battery = response[10] * 0.059
try:
sys_info.connection_type = ConnectionType(response[11])
# Mask FCS bits out of response[11]
sys_info.connection_type = ConnectionType(response[11] & 0b00110011)
except ValueError:
sys_info.connection_type = ConnectionType.unknown
sys_info.previous_polls = response[13]
Expand Down

0 comments on commit 870d3be

Please sign in to comment.