Skip to content

Commit

Permalink
firmware: devices: obdh: Adding support to timestamp param write #164
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelboing committed Oct 4, 2024
1 parent efc5c65 commit 465af53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion firmware/devices/obdh/obdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ int obdh_read_request(obdh_request_t *obdh_request)
{
obdh_request->data.param_8 = request[3];
}
else if (obdh_request->parameter == CMDPR_PARAM_TIMESTAMP)
{
obdh_request->data.param_32 = (uint32_t)(request[3]) << 24U | (uint32_t)(request[4]) << 16U |
(uint32_t)(request[5]) << 8U | (uint32_t)(request[6]);
}
else
{
sys_log_print_event_from_module(SYS_LOG_ERROR, OBDH_MODULE_NAME, "Unknown parameter:");
Expand Down Expand Up @@ -211,7 +216,7 @@ int obdh_write_response_param(ttc_data_t *ttc_data_buf, obdh_response_t *obdh_re
obdh_response->data.param_32 = ttc_data_buf->fw_version;

break;
case CMDPR_PARAM_COUNTER:
case CMDPR_PARAM_TIMESTAMP:
obdh_response->data.param_32 = ttc_data_buf->timestamp;

break;
Expand Down

0 comments on commit 465af53

Please sign in to comment.