machine missing functions?
Posted: Sun Nov 08, 2020 10:25 pm
I have spent the last week working on a pyboard project to monitor stream environments. So far things are going well with I2C and analog sensors. I got to the point of working on the sleep cycles, and have discovered that there is no machine.wake_reason function in the machine module. I am trying to be sure I don't lock up the board, since after it does data collection is is putting things into a deep sleep, so I want to make sure it only runs this code when woken up via the RTC (if machine.wake_state() == machine.RTC_WAKE)
I had reflashed the board (D series) the other day to make sure it was updated (PYBD-SF2-20200902-v1.13.dfu).
This is what appears in the machine module:
>>> dir(machine)
['__class__', '__name__', 'ADC', 'RTC', 'DEEPSLEEP_RESET', 'HARD_RESET', 'I2C', 'PWRON_RESET', 'Pin', 'SOFT_RESET', 'SPI', 'Signal', 'Timer', 'UART', 'WDT', 'WDT_RESET', 'bootloader', 'deepsleep', 'disable_irq', 'enable_irq', 'freq', 'idle', 'info', 'lightsleep', 'mem16', 'mem32', 'mem8', 'reset', 'reset_cause', 'rng', 'sleep', 'soft_reset', 'time_pulse_us', 'unique_id']
Has the library been change recently, and if so, is there a comparable function? Or, do I need a different update? There doesn't seem to be an equivalent function in pyb.
Thanks,
Howard
I had reflashed the board (D series) the other day to make sure it was updated (PYBD-SF2-20200902-v1.13.dfu).
This is what appears in the machine module:
>>> dir(machine)
['__class__', '__name__', 'ADC', 'RTC', 'DEEPSLEEP_RESET', 'HARD_RESET', 'I2C', 'PWRON_RESET', 'Pin', 'SOFT_RESET', 'SPI', 'Signal', 'Timer', 'UART', 'WDT', 'WDT_RESET', 'bootloader', 'deepsleep', 'disable_irq', 'enable_irq', 'freq', 'idle', 'info', 'lightsleep', 'mem16', 'mem32', 'mem8', 'reset', 'reset_cause', 'rng', 'sleep', 'soft_reset', 'time_pulse_us', 'unique_id']
Has the library been change recently, and if so, is there a comparable function? Or, do I need a different update? There doesn't seem to be an equivalent function in pyb.
Thanks,
Howard