From 21d62c0c3630f865a9b12a4946bc835f1edcb6a5 Mon Sep 17 00:00:00 2001 From: gussy Date: Sat, 5 Dec 2009 23:53:41 +0000 Subject: [PATCH] Fixed logging queue. Added to comments in openpilot.c git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@58 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/OpenPilot/op_logging.c | 3 +++ flight/OpenPilot/openpilot.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/flight/OpenPilot/op_logging.c b/flight/OpenPilot/op_logging.c index 2680fa168..d36a004fe 100644 --- a/flight/OpenPilot/op_logging.c +++ b/flight/OpenPilot/op_logging.c @@ -47,6 +47,9 @@ void OP_Logging_Init(void) uint16_t FileCount; FILINFO DummyFileInfo; + /* Create the logging queue */ + xLoggingQueue = xQueueCreate(15, sizeof(LogTypeDef)); + /* This is a crude way to file the next avaiable number avaiable */ /* The proper way would be to use folders with dates, we will get to that later */ for(FileCount = 0; FileCount < 65536; FileCount++) { diff --git a/flight/OpenPilot/openpilot.c b/flight/OpenPilot/openpilot.c index 1ebbffa66..8d70af96c 100644 --- a/flight/OpenPilot/openpilot.c +++ b/flight/OpenPilot/openpilot.c @@ -32,7 +32,6 @@ /* Local Functions */ -static void ServosTask(void *pvParameters); /** @@ -52,13 +51,17 @@ void OpenPilotInit(void) -> GPS: Simply parses incomming GPS data and puts it into the GPS struct, also set states of FIX/NOFIX etc. -> Gatekeepers: Tasks which use queue's to access shared resources -> MicroSD: Simply logs data to the MicroSD card - -> Telemetry: Sends (and receives?) telemetry usig a que + -> Telemetry: Sends telemetry using a queue - Supervisor should have highest possibly priority (Idle + 14?) + - Supervisor should also act as the warnings system, low batter etc) + - Supervisor should handle all telemetry inputs (not outputs), and act accordingly - Sub tasks of the supervisor should have a priority just lower than the supervisor (Idle + 12?) - - Sub tasks of the supervisor shoud ONLY be pre-empted by interrupts such as the GPS tasks + - Sub tasks of the supervisor shoud ONLY be pre-empted by system interrupts such as UART, I2C etc - Gatekeepers should sit in a blocked state while there is nothing on the que, with a low priority - - With the low priority of gatekeepers, the should only be running while the supervisor tasks are not working + - With the low priority of gatekeepers, they should only be running while the supervisor tasks are not working + + - I2C module sending and receiving needs to be included in here somwhere. Inputs would be interrupt triggered. */ }