1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Make the firmwareIAP variable not a global

This commit is contained in:
James Cotton 2012-03-26 00:16:28 -05:00
parent 9b33be5d65
commit a0b7453580

View File

@ -66,8 +66,6 @@ static portTickType lastResetSysTime;
// Private functions
static void FirmwareIAPCallback(UAVObjEvent* ev);
FirmwareIAPObjData data;
static uint32_t get_time(void);
// Private types
@ -96,6 +94,9 @@ int32_t FirmwareIAPInitialize()
const struct pios_board_info * bdinfo = &pios_board_info_blob;
FirmwareIAPObjData data;
FirmwareIAPObjGet(&data);
data.BoardType= bdinfo->board_type;
PIOS_BL_HELPER_FLASH_Read_Description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
@ -125,6 +126,9 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
if(iap_state == IAP_STATE_RESETTING)
return;
FirmwareIAPObjData data;
FirmwareIAPObjGet(&data);
if ( ev->obj == FirmwareIAPObjHandle() ) {
// Get the input object data
@ -238,7 +242,10 @@ static void resetTask(UAVObjEvent * ev)
#if defined (PIOS_LED_ALARM)
PIOS_LED_Toggle(PIOS_LED_ALARM);
#endif /* PIOS_LED_ALARM */
FirmwareIAPObjData data;
FirmwareIAPObjGet(&data);
if((portTickType) (xTaskGetTickCount() - lastResetSysTime) > RESET_DELAY / portTICK_RATE_MS) {
lastResetSysTime = xTaskGetTickCount();
data.BoardType=0xFF;