InitializationAfter disabling interrupts, the initialization routine writes the alarm code ALM_INIT in memory and illuminates the ALARM LED signaling that Firmware initialization is taking place.
The initialization routine continues to configure on-chip resources and memory variables, including UART, on-chip timers and Virtual Timers.
As mentioned earlier in this manual, GPIO configuration is stored in FLASH as results of a SETUP GPIO serial command. Also in FLASH is a "setup bit" telling whether or not that command have been ever received. If that bit is set, the initialization routine configures GPIO ports as indicated in FLASH, putting all GPOs in no-activated status; otherwise, all GPIO ports are configured as inputs.
Before ending, the initialization routines writes the alarm code ALM_NONE. If the "setup bit" is clear, it also turns the ALARM LED off; otherwise, it let it on signaling that the unit has not been setup yet.
Initialization ends by enabling interrupts before falling into the Main Loop.
|