mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
LP-537 Changes startup code on GPSV9 to call PIOS_Board_Init after scheduler start.
This commit is contained in:
parent
b47a3ad393
commit
081fda25a1
@ -44,6 +44,7 @@
|
||||
#include "inc/gps9flashhandler.h"
|
||||
#include "inc/gps9protocol.h"
|
||||
#include "pios_board_info.h"
|
||||
#include "pios_board_init.h"
|
||||
|
||||
extern uint32_t pios_com_main_id;
|
||||
|
||||
@ -107,9 +108,17 @@ static void gpspSystemTask(__attribute__((unused)) void *parameters)
|
||||
#ifdef PIOS_INCLUDE_WDG
|
||||
PIOS_WDG_UpdateFlag(PIOS_WDG_SYSTEM);
|
||||
#endif
|
||||
|
||||
/* board driver init */
|
||||
PIOS_Board_Init();
|
||||
|
||||
/* Initialize all modules */
|
||||
MODULE_INITIALISE_ALL;
|
||||
|
||||
while (!initTaskDone) {
|
||||
vTaskDelay(10);
|
||||
}
|
||||
|
||||
#ifndef PIOS_INCLUDE_WDG
|
||||
// if no watchdog is enabled, don't reset watchdog in MODULE_TASKCREATE_ALL loop
|
||||
#define PIOS_WDG_Clear()
|
||||
@ -127,6 +136,7 @@ static void gpspSystemTask(__attribute__((unused)) void *parameters)
|
||||
#if defined(PIOS_INCLUDE_IAP)
|
||||
PIOS_IAP_WriteBootCount(0);
|
||||
#endif
|
||||
|
||||
/* Right now there is no configuration and uart speed is fixed at 57600.
|
||||
* TODO:
|
||||
* 1) add a tiny ubx parser on gps side to intercept CFG-RINV and use that for config storage;
|
||||
|
@ -42,6 +42,7 @@
|
||||
/* Global Variables */
|
||||
|
||||
extern void Stack_Change(void);
|
||||
extern void GPSPSystemModStart(void);
|
||||
|
||||
/**
|
||||
* OpenPilot Main function:
|
||||
@ -54,32 +55,19 @@ extern void Stack_Change(void);
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
/* NOTE: Do NOT modify the following start-up sequence */
|
||||
/* Any new initialization functions should be added in OpenPilotInit() */
|
||||
|
||||
/* Brings up System using CMSIS functions, enables the LEDs. */
|
||||
PIOS_SYS_Init();
|
||||
|
||||
/* Architecture dependant Hardware and
|
||||
* core subsystem initialisation
|
||||
* (see pios_board.c for your arch)
|
||||
* */
|
||||
PIOS_Board_Init();
|
||||
/*
|
||||
* Initialize the system module, which configures the board and
|
||||
* starts the other modules.
|
||||
*/
|
||||
GPSPSystemModStart();
|
||||
|
||||
/* Initialize modules */
|
||||
MODULE_INITIALISE_ALL
|
||||
/* swap the stack to use the IRQ stack */
|
||||
Stack_Change();
|
||||
|
||||
/* Start the FreeRTOS scheduler, which should never return.
|
||||
*
|
||||
* NOTE: OpenPilot runs an operating system (FreeRTOS), which constantly calls
|
||||
* (schedules) function files (modules). These functions never return from their
|
||||
* while loops, which explains why each module has a while(1){} segment. Thus,
|
||||
* the OpenPilot software actually starts at the vTaskStartScheduler() function,
|
||||
* even though this is somewhat obscure.
|
||||
*
|
||||
*/
|
||||
/* Start the FreeRTOS scheduler */
|
||||
vTaskStartScheduler();
|
||||
|
||||
/* If all is well we will never reach here as the scheduler will now be running. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user