BootloaderPIC32/Bootloader_PIC32.X/Source/BootloaderStateMachine.h
2020-11-16 05:47:46 -05:00

37 lines
736 B
C

#ifndef BOOTLOADER_STATE_MACHINE_H
#define BOOTLOADER_STATE_MACHINE_H
#define SM_NULL_DATA 0
#define PSEUDO_TIMER_VALUE 1500000
#define BOOTLOADER_UNLOCK_CODE 0xA5
enum eBootloaderSMStates
{
SM_UPDATE_WAIT_STATE,
SM_IDLE_STATE,
SM_WAIT_FOR_UNLOCK_STATE,
SM_WAIT_FOR_NEXT_RECORD
};
enum eBootloaderEvents
{
SM_TICK_EVENT,
SM_RX_CMD_EVENT,
SM_ABORT_UPDATE
};
void BootloaderSMInit(void);
void BootloaderSM( unsigned int event, unsigned int Data );
void JumpToApp(void);
void DownloadFlash(unsigned int StartAddress, unsigned int EndAddress);
#endif
//===========================================================================
// End of file.
//===========================================================================