dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Read the firmware IAP values

Files

file  firmwareiap.c
 In Application Programming module to support firmware upgrades by providing a means to enter the bootloader.
 
file  firmwareiap.c
 In Application Programming module to support firmware upgrades by providing a means to enter the bootloader.
 

Macros

#define IAP_CMD_STEP_1   1122
 
#define IAP_CMD_STEP_2   2233
 
#define IAP_CMD_STEP_3   3344
 
#define IAP_CMD_STEP_3NB   4455
 
#define IAP_CMD_CRC   100
 
#define IAP_CMD_VERIFY   101
 
#define IAP_CMD_VERSION   102
 
#define IAP_STATE_READY   0
 
#define IAP_STATE_STEP_1   1
 
#define IAP_STATE_STEP_2   2
 
#define IAP_STATE_RESETTING   3
 
#define RESET_DELAY_MS   500 /* delay before sending reset to INS */
 

Functions

static void FirmwareIAPCallback (const UAVObjEvent *ev, void *ctx, void *obj, int len)
 FirmwareIAPCallback - callback function for firmware IAP requests. More...
 
static uint32_t get_time (void)
 Returns number of milliseconds from the start of the kernel. More...
 
static void resetTask (const UAVObjEvent *ev, void *ctx, void *obj, int len)
 
int32_t FirmwareIAPInitialize ()
 Performs object initialization functions. More...
 
int32_t FirmwareIAPStart ()
 
void FirmwareIAPSetBoardRev (uint8_t rev)
 

Variables

const uint32_t iap_time_2_low_end = 500
 
const uint32_t iap_time_2_high_end = 5000
 
const uint32_t iap_time_3_low_end = 500
 
const uint32_t iap_time_3_high_end = 5000
 
static uint8_t reset_count = 0
 
static uint32_t lastResetSysTime
 
static uint8_t board_rev = 0
 

Detailed Description

Macro Definition Documentation

#define IAP_CMD_CRC   100

Definition at line 50 of file firmwareiap.c.

#define IAP_CMD_STEP_1   1122

Definition at line 45 of file firmwareiap.c.

#define IAP_CMD_STEP_2   2233

Definition at line 46 of file firmwareiap.c.

#define IAP_CMD_STEP_3   3344

Definition at line 47 of file firmwareiap.c.

#define IAP_CMD_STEP_3NB   4455

Definition at line 48 of file firmwareiap.c.

#define IAP_CMD_VERIFY   101

Definition at line 51 of file firmwareiap.c.

#define IAP_CMD_VERSION   102

Definition at line 52 of file firmwareiap.c.

#define IAP_STATE_READY   0

Definition at line 54 of file firmwareiap.c.

#define IAP_STATE_RESETTING   3

Definition at line 57 of file firmwareiap.c.

#define IAP_STATE_STEP_1   1

Definition at line 55 of file firmwareiap.c.

#define IAP_STATE_STEP_2   2

Definition at line 56 of file firmwareiap.c.

#define RESET_DELAY_MS   500 /* delay before sending reset to INS */

Definition at line 59 of file firmwareiap.c.

Function Documentation

static void FirmwareIAPCallback ( const UAVObjEvent ev,
void *  ctx,
void *  obj,
int  len 
)
static

FirmwareIAPCallback - callback function for firmware IAP requests.

Parameters
[in]ev- pointer objevent
Return values
None.
Note

Definition at line 127 of file firmwareiap.c.

int32_t FirmwareIAPInitialize ( )

Performs object initialization functions.

Initialise the module, called on startup.

Returns
0 on success or -1 if initialisation failed
0 - under all cases
Note

Definition at line 94 of file firmwareiap.c.

void FirmwareIAPSetBoardRev ( uint8_t  rev)

Definition at line 262 of file firmwareiap.c.

int32_t FirmwareIAPStart ( )

Definition at line 257 of file firmwareiap.c.

static uint32_t get_time ( void  )
static

Returns number of milliseconds from the start of the kernel.

Returns
number of milliseconds from the start of the kernel.
Note

Definition at line 228 of file firmwareiap.c.

static void resetTask ( const UAVObjEvent ev,
void *  ctx,
void *  obj,
int  len 
)
static

Executed by event dispatcher callback to reset INS before resetting OP

Definition at line 236 of file firmwareiap.c.

Variable Documentation

uint8_t board_rev = 0
static

Definition at line 71 of file firmwareiap.c.

const uint32_t iap_time_2_high_end = 5000

Definition at line 62 of file firmwareiap.c.

const uint32_t iap_time_2_low_end = 500

Definition at line 61 of file firmwareiap.c.

const uint32_t iap_time_3_high_end = 5000

Definition at line 64 of file firmwareiap.c.

const uint32_t iap_time_3_low_end = 500

Definition at line 63 of file firmwareiap.c.

uint32_t lastResetSysTime
static

Definition at line 70 of file firmwareiap.c.

uint8_t reset_count = 0
static

Definition at line 69 of file firmwareiap.c.