-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Thermal Mgr Task #285
base: main
Are you sure you want to change the base?
Changes from 1 commit
c2caffd
d13a987
72b7235
38111b7
19bd58c
fb02de2
83d5389
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
#define TASK_PAYLOAD_MGR_WATCHDOG_TIMEOUT portMAX_DELAY | ||
#define TASK_TIMEKEEPER_WATCHDOG_TIMEOUT portMAX_DELAY | ||
#define TASK_ALARM_MGR_WATCHDOG_TIMEOUT portMAX_DELAY | ||
#define TASK_HEALTH_COLLECTOR_WATCHDOG_TIMEOUT portMAX_DELAY | ||
#define TASK_THERMAL_MGR_WATCHDOG_TIMEOUT pdMS_TO_TICKS(1000) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. watchdog timeout shouldl generally be 2x task rate |
||
#define TASK_STATS_COLLECTOR_WATCHDOG_TIMEOUT portMAX_DELAY | ||
#define TASK_LOGGER_WATCHDOG_TIMEOUT portMAX_DELAY | ||
#define TASK_DIGITAL_WATCHDOG_MGR_WATCHDOG_TIMEOUT portMAX_DELAY | ||
|
@@ -75,9 +75,9 @@ static watchdog_task_info_t watchdogTaskArray[] = { | |
{ | ||
.taskTimeoutTicks = TASK_ALARM_MGR_WATCHDOG_TIMEOUT, | ||
}, | ||
[OBC_SCHEDULER_CONFIG_ID_HEALTH_COLLECTOR] = | ||
[OBC_SCHEDULER_CONFIG_ID_THERMAL_MGR] = | ||
{ | ||
.taskTimeoutTicks = TASK_HEALTH_COLLECTOR_WATCHDOG_TIMEOUT, | ||
.taskTimeoutTicks = TASK_THERMAL_MGR_WATCHDOG_TIMEOUT, | ||
}, | ||
[OBC_SCHEDULER_CONFIG_ID_LOGGER] = | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,40 @@ | ||
#include "health_collector.h" | ||
#include "thermal_mgr.h" | ||
#include "lm75bd.h" | ||
#include "obc_time.h" | ||
#include "telemetry_manager.h" | ||
#include "obc_errors.h" | ||
#include "obc_logging.h" | ||
#include "obc_scheduler_config.h" | ||
#include <obc_digital_watchdog.h> | ||
#include "digital_watchdog_mgr.h" | ||
|
||
#include <FreeRTOS.h> | ||
#include <os_portmacro.h> | ||
#include <os_task.h> | ||
#include <sys_common.h> | ||
#include <os_queue.h> | ||
|
||
#define HEALTH_COLLECTION_PERIOD_MS 60000UL | ||
#define THERMAL_MGR_PERIOD_MS 1000 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on our telemetry sheet, it should take the temperature once every minute, not once a sec. Also add U to the end |
||
static obc_error_code_t collectObcLm75bdTemp(void); | ||
void obcTaskInitThermalMgr() {} | ||
static obc_error_code_t collectObcLm75bdTemp(void); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This task should init the lm75bd |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Push this above the obcTaskInit function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: fix indent |
||
void obcTaskInitHealthCollector(void) {} | ||
|
||
void obcTaskFunctionHealthCollector(void* pvParameters) { | ||
void obcTaskFunctionThermalMgr(void* pvParameters) { | ||
obc_error_code_t errCode; | ||
TickType_t xLastWakeTime; | ||
|
||
xLastWakeTime = xTaskGetTickCount(); | ||
|
||
while (1) { | ||
LOG_IF_ERROR_CODE(collectObcLm75bdTemp()); | ||
vTaskDelay(pdMS_TO_TICKS(HEALTH_COLLECTION_PERIOD_MS)); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should be implementing these mailboxes in this pr https://discord.com/channels/831191521595621387/1124186460866740314/1181054461494444082 Don;t need to have other tasks sending anything to the queue right now but the queues and thermal mgr side shpuld be set up |
||
digitalWatchdogTaskCheckIn(OBC_SCHEDULER_CONFIG_ID_THERMAL_MGR); | ||
|
||
vTaskDelayUntil(&xLastWakeTime, pdMS_TO_TICKS(THERMAL_MGR_PERIOD_MS)); | ||
} | ||
|
||
|
||
} | ||
|
||
static obc_error_code_t collectObcLm75bdTemp(void) { | ||
static obc_error_code_t collectObcLm75bdTemp(void) { | ||
obc_error_code_t errCode; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: fix indent |
||
|
||
float temp = 0.0f; | ||
|
@@ -36,4 +45,5 @@ static obc_error_code_t collectObcLm75bdTemp(void) { | |
RETURN_IF_ERROR_CODE(addTelemetryData(&obcTempVal)); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make telem a flag that is passed in since we may want to just read the value sometimes to make sure we are safe without adding that as telemetry |
||
return OBC_ERR_CODE_SUCCESS; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this with changed tick delay