summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-10-15 20:11:43 +1100
committerDamien George <damien@micropython.org>2020-10-16 10:44:58 +1100
commitdfb63b56134dc054b2e0023d9a404dea749d1fee (patch)
tree43ca59a347cc42d8512d4613d0f3fcf6c5358c7e
parent520bb88d70893287b2c2728259cd020ddc710eaf (diff)
stm32/boards/NUCLEO_WB55/rfcore_firmware.py: Fix bad variable name.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r--ports/stm32/boards/NUCLEO_WB55/rfcore_firmware.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/ports/stm32/boards/NUCLEO_WB55/rfcore_firmware.py b/ports/stm32/boards/NUCLEO_WB55/rfcore_firmware.py
index de98d9743..3358b246d 100644
--- a/ports/stm32/boards/NUCLEO_WB55/rfcore_firmware.py
+++ b/ports/stm32/boards/NUCLEO_WB55/rfcore_firmware.py
@@ -370,18 +370,18 @@ def resume():
return _write_failure_state(REASON_RFCORE_NOT_CONFIGURED)
while True:
- _STATE_id = _read_state()
+ state = _read_state()
- if _STATE_id == _STATE_IDLE:
+ if state == _STATE_IDLE:
log("Firmware update complete")
return 0
- elif _STATE_id == _STATE_FAILED:
+ elif state == _STATE_FAILED:
log("Firmware update failed")
return _read_failure_reason()
# Keep calling GET_STATE until error or FUS.
- elif _STATE_id == _STATE_WAITING_FOR_FUS:
+ elif state == _STATE_WAITING_FOR_FUS:
log("Querying FUS state")
status, result = fus_get_state()
log("FUS state: {} {}", status, result)
@@ -395,7 +395,7 @@ def resume():
_write_state(_STATE_CHECK_UPDATES)
# Keep trying to start the WS until !fus_active() (or error).
- elif _STATE_id == _STATE_WAITING_FOR_WS:
+ elif state == _STATE_WAITING_FOR_WS:
if stm.rfcore_status() != _MAGIC_FUS_ACTIVE:
log("WS active")
_write_state(_STATE_IDLE)
@@ -410,7 +410,7 @@ def resume():
_write_failure_state(REASON_NO_WS)
# Sequence the FUS 1.0.2 -> FUS 1.1.0 -> WS (depending on what's available).
- elif _STATE_id == _STATE_CHECK_UPDATES:
+ elif state == _STATE_CHECK_UPDATES:
log("Checking for updates")
fus_version = stm.rfcore_fw_version(_FW_VERSION_FUS)
log("FUS version {}", fus_version)
@@ -448,13 +448,13 @@ def resume():
# This shouldn't happen - the flash write should always complete and
# move straight onto the COPIED state. Failure here indicates that
# the rfcore is misconfigured or the WS firmware was not deleted first.
- elif _STATE_id == _STATE_COPYING_FUS or _STATE_id == _STATE_COPYING_WS:
+ elif state == _STATE_COPYING_FUS or state == _STATE_COPYING_WS:
log("Flash copy failed mid-write")
_write_failure_state(REASON_FLASH_COPY_FAILED)
# Flash write completed, we should immediately see GET_STATE return 0,0
# so we can start the FUS install.
- elif _STATE_id == _STATE_COPIED_FUS:
+ elif state == _STATE_COPIED_FUS:
if fus_is_idle():
log("FUS copy complete, installing")
_write_state(_STATE_INSTALLING_FUS)
@@ -466,7 +466,7 @@ def resume():
# Keep polling the state until we see a 0,0 (success) or non-transient
# error. In general we should expect to see (16,0) several times,
# followed by a (255,0), followed by (0, 0).
- elif _STATE_id == _STATE_INSTALLING_FUS:
+ elif state == _STATE_INSTALLING_FUS:
log("Installing FUS...")
status, result = fus_get_state()
log("FUS state: {} {}", status, result)
@@ -492,7 +492,7 @@ def resume():
# Keep polling the state until we see 0,0 or failure (1,0). Any other
# result means retry (but the docs say that 0 and 1 are the only
# status values).
- elif _STATE_id == _STATE_DELETING_WS:
+ elif state == _STATE_DELETING_WS:
log("Deleting WS...")
status, result = fus_get_state()
log("FUS state: {} {}", status, result)
@@ -508,7 +508,7 @@ def resume():
_write_failure_state(REASON_WS_DELETION_FAILED)
# As for _STATE_COPIED_FUS above. We should immediately see 0,0.
- elif _STATE_id == _STATE_COPIED_WS:
+ elif state == _STATE_COPIED_WS:
if fus_is_idle():
log("WS copy complete, installing")
_write_state(_STATE_INSTALLING_WS)
@@ -518,7 +518,7 @@ def resume():
_write_failure_state(REASON_FLASH_WS_BAD_STATE)
# As for _STATE_INSTALLING_FUS above.
- elif _STATE_id == _STATE_INSTALLING_WS:
+ elif state == _STATE_INSTALLING_WS:
log("Installing WS...")
status, result = fus_get_state()
log("FUS state: {} {}", status, result)