-
Carlo Alessandro Nicolau authoredCarlo Alessandro Nicolau authored
command_BOARDTIME.c 1.09 KiB
// Auto-generated template file: command_BOARDTIME.tpl.c
// Generation timestamp: 2021-06-17 18:31:59.933877
#include "../typedefs.h"
#include "../communication.h"
#include "../hardware.h"
#include "../timing.h" // NOT INCLUDED IN GENERATED CODE
err_t command_BOARDTIME(void) {
// Command: BOARDTIME
// Description: Time since last reset
//
// Request code: CMDCODE_BOARDTIME_REQ
// Response code: CMDCODE_BOARDTIME_REQ
// Request payload (length in bytes is 0):
// Response payload (length in bytes is 4):
// field #0 (4 bytes) [type: uint32_t ] : SECONDS (Seconds since reset)
// Auto-generated section: request payload fields reading
// End of auto-generated section
// USER CODE HERE
// CHECK : OK (tested with an approx 30s interval)
uint32_t resp_seconds = timing_get_seconds_since_reset();
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
communication_response_payload_append_uint32_t((uint32_t)resp_seconds);
return NOERR;
// End of auto-generated section
}