-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firmware: app: tasks: Initial structure of the parameter server task #…
- Loading branch information
Showing
5 changed files
with
138 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* param_server.h | ||
* | ||
* Copyright (C) 2021, SpaceLab. | ||
* | ||
* This file is part of EPS 2.0. | ||
* | ||
* EPS 2.0 is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* EPS 2.0 is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with EPS 2.0. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* \brief Parameter server task implementation. | ||
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.1 | ||
* | ||
* \date 2021/06/30 | ||
* | ||
* \addtogroup param_server | ||
* \{ | ||
*/ | ||
|
||
#include "param_server.h" | ||
|
||
xTaskHandle xTaskParamServerHandle; | ||
|
||
void vTaskParamServer(void *pvParameters) | ||
{ | ||
/* Delay before the first cycle */ | ||
vTaskDelay(pdMS_TO_TICKS(TASK_PARAM_SERVER_INITIAL_DELAY_MS)); | ||
|
||
while(1) | ||
{ | ||
TickType_t last_cycle = xTaskGetTickCount(); | ||
|
||
/* TODO */ | ||
|
||
vTaskDelayUntil(&last_cycle, pdMS_TO_TICKS(TASK_PARAM_SERVER_PERIOD_MS)); | ||
} | ||
} | ||
|
||
/** \} End of param_server group */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* param_server.c | ||
* | ||
* Copyright (C) 2021, SpaceLab. | ||
* | ||
* This file is part of EPS 2.0. | ||
* | ||
* EPS 2.0 is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* EPS 2.0 is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with EPS 2.0. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* \brief Parameter server task definition. | ||
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.1 | ||
* | ||
* \date 2021/06/30 | ||
* | ||
* \defgroup param_server Parameter server | ||
* \ingroup tasks | ||
* \{ | ||
*/ | ||
|
||
#ifndef PARAM_SERVER_H_ | ||
#define PARAM_SERVER_H_ | ||
|
||
#include <FreeRTOS.h> | ||
#include <task.h> | ||
|
||
#define TASK_PARAM_SERVER_NAME "Param Server" /**< Task name. */ | ||
#define TASK_PARAM_SERVER_STACK_SIZE 300 /**< Stack size in bytes. */ | ||
#define TASK_PARAM_SERVER_PRIORITY 4 /**< Task priority. */ | ||
#define TASK_PARAM_SERVER_PERIOD_MS 50 /**< Task period in milliseconds. */ | ||
#define TASK_PARAM_SERVER_INITIAL_DELAY_MS 1000 /**< Delay, in milliseconds, before the first execution. */ | ||
|
||
/** | ||
* \brief Parameter server handle. | ||
*/ | ||
extern xTaskHandle xTaskParamServerHandle; | ||
|
||
/** | ||
* \brief Parameter server task. | ||
* | ||
* \param[in] pvParameters is a value that will passed as the task's parameter. | ||
* | ||
* \return None. | ||
*/ | ||
void vTaskParamServer(void *pvParameters); | ||
|
||
#endif /* PARAM_SERVER_H_ */ | ||
|
||
/** \} End of param_server group */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.0 | ||
* \version 0.2.1 | ||
* | ||
* \date 2021/04/09 | ||
* | ||
|
@@ -44,6 +44,7 @@ | |
#include "watchdog_reset.h" | ||
#include "system_reset.h" | ||
#include "read_sensors.h" | ||
#include "param_server.h" | ||
|
||
void create_tasks() | ||
{ | ||
|
@@ -96,6 +97,15 @@ void create_tasks() | |
} | ||
#endif /* CONFIG_TASK_READ_SENSORS_ENABLED */ | ||
|
||
#if CONFIG_TASK_PARAM_SERVER_ENABLED == 1 | ||
xTaskCreate(vTaskParamServer, TASK_PARAM_SERVER_NAME, TASK_PARAM_SERVER_STACK_SIZE, NULL, TASK_PARAM_SERVER_PRIORITY, &xTaskParamServerHandle); | ||
|
||
if (xTaskParamServerHandle == NULL) | ||
{ | ||
/* Error creating the parameter server task */ | ||
} | ||
#endif /* CONFIG_TASK_PARAM_SERVER_ENABLED */ | ||
|
||
create_event_groups(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* config.h | ||
* | ||
* Copyright (C) 2020, SpaceLab. | ||
* Copyright (C) 2021, SpaceLab. | ||
* | ||
* This file is part of EPS 2.0. | ||
* | ||
|
@@ -23,9 +23,10 @@ | |
/** | ||
* \brief Configuration parameters definition. | ||
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> and Augusto Cezar Boldori Vassoler <[email protected]> | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* \author Augusto Cezar Boldori Vassoler <[email protected]> | ||
* | ||
* \version 0.2.0 | ||
* \version 0.2.1 | ||
* | ||
* \date 2021/01/25 | ||
* | ||
|
@@ -42,6 +43,7 @@ | |
#define CONFIG_TASK_HEARTBEAT_ENABLED 1 | ||
#define CONFIG_TASK_SYSTEM_RESET_ENABLED 0 | ||
#define CONFIG_TASK_READ_SENSORS_ENABLED 1 | ||
#define CONFIG_TASK_PARAM_SERVER_ENABLED 1 | ||
|
||
#define CONFIG_DRIVERS_DEBUG_ENABLED 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.0 | ||
* \version 0.2.1 | ||
* | ||
* \date 2020/10/21 | ||
* | ||
|
@@ -36,7 +36,7 @@ | |
#ifndef VERSION_H_ | ||
#define VERSION_H_ | ||
|
||
#define FIRMWARE_VERSION "0.2.0" | ||
#define FIRMWARE_VERSION "0.2.1" | ||
|
||
#define FIRMWARE_STATUS "Development" | ||
|
||
|