Skip to content

Commit

Permalink
firmware: app: tasks: Support to timestamp write request #164
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelboing committed Oct 4, 2024
1 parent 465af53 commit 34ca297
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion firmware/app/tasks/obdh_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,25 @@ void vTaskObdhServer(void)

break;
case CMDPR_PARAM_RESET_DEVICE:

if (obdh_request.data.param_8 == 0x01)
{
sys_log_print_event_from_module(SYS_LOG_INFO, TASK_OBDH_SERVER_NAME, "Received command to reset system...");
system_reset();
}
break;

case CMDPR_PARAM_TIMESTAMP:
ttc_data_buf.timestamp = obdh_request.data.param_32;

system_set_time((sys_time_t)obdh_request.data.param_32);

sys_log_print_event_from_module(SYS_LOG_INFO, TASK_OBDH_SERVER_NAME, "Updating system time to ");
sys_log_print_uint(ttc_data_buf.timestamp);
sys_log_print_msg(".");
sys_log_new_line();

break;

default:
sys_log_print_event_from_module(SYS_LOG_ERROR, TASK_OBDH_SERVER_NAME, "Invalid write parameter.");

Expand Down

0 comments on commit 34ca297

Please sign in to comment.