Skip to content

Commit

Permalink
Fix build issues after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
DeflateAwning committed Jul 21, 2024
1 parent d5b252c commit 13edf46
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
6 changes: 1 addition & 5 deletions firmware/Core/Inc/debug_tools/debug_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ void DEBUG_uart_print_str(const char *str);
void DEBUG_uart_print_uint32(uint32_t value);
void DEBUG_uart_print_int32(int32_t value);
void DEBUG_uart_print_uint64(uint64_t value);
void DEBUG_uart_print_array_hex(uint8_t *array, uint32_t array_len);


void DEBUG_uart_print_array_hex(
const uint8_t* arr, uint16_t len, const char* end_str);
void DEBUG_uart_print_array_hex(const uint8_t *array, uint32_t array_len);

#endif // __INCLUDE_GUARD__DEBUG_UART_H__
4 changes: 2 additions & 2 deletions firmware/Core/Inc/telecommands/eps_telecommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "telecommands/telecommand_definitions.h"


uint8_t TCMDEXEC_eps_watchdog(const uint8_t *args_str, TCMD_TelecommandChannel_enum_t tcmd_channel,
uint8_t TCMDEXEC_eps_watchdog(const char *args_str, TCMD_TelecommandChannel_enum_t tcmd_channel,
char *response_output_buf, uint16_t response_output_buf_len);

uint8_t TCMDEXEC_eps_get_system_status_json(const uint8_t *args_str,
uint8_t TCMDEXEC_eps_get_system_status_json(const char *args_str,
TCMD_TelecommandChannel_enum_t tcmd_channel,
char *response_output_buf, uint16_t response_output_buf_len);

Expand Down
2 changes: 1 addition & 1 deletion firmware/Core/Src/debug_tools/debug_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void DEBUG_uart_print_uint64(uint64_t value) {
DEBUG_uart_print_str(buffer);
}

void DEBUG_uart_print_array_hex(uint8_t *array, uint32_t array_len) {
void DEBUG_uart_print_array_hex(const uint8_t *array, uint32_t array_len) {
for (uint32_t i = 0; i < array_len; i++) {
char buffer[4];
snprintf(buffer, 4, "%02X ", array[i]);
Expand Down
12 changes: 7 additions & 5 deletions firmware/Core/Src/eps_drivers/eps_internal_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ uint8_t EPS_send_cmd_get_response(

if (EPS_ENABLE_DEBUG_PRINT) {
DEBUG_uart_print_str("OBC->EPS DATA (no tags): ");
DEBUG_uart_print_array_hex(cmd_buf, cmd_buf_len, "\n");
DEBUG_uart_print_str("OBC->EPS DATA (with tags): ");
DEBUG_uart_print_array_hex(cmd_buf_with_tags, cmd_buf_with_tags_len, "\n");
DEBUG_uart_print_array_hex(cmd_buf, cmd_buf_len);
DEBUG_uart_print_str("\nOBC->EPS DATA (with tags): ");
DEBUG_uart_print_array_hex(cmd_buf_with_tags, cmd_buf_with_tags_len);
DEBUG_uart_print_str("\n");
}

// TX TO EPS
Expand Down Expand Up @@ -114,7 +115,7 @@ uint8_t EPS_send_cmd_get_response(

// For now, log the received bytes
DEBUG_uart_print_str("EPS->OBC DATA (with tags): ");
DEBUG_uart_print_array_hex((uint8_t*)UART_eps_buffer, UART_eps_buffer_write_idx, "");
DEBUG_uart_print_array_hex((uint8_t*)UART_eps_buffer, UART_eps_buffer_write_idx);
DEBUG_uart_print_str("\n");

// Check that we've received what we're expecting
Expand Down Expand Up @@ -170,7 +171,8 @@ uint8_t EPS_send_cmd_get_response(

if (EPS_ENABLE_DEBUG_PRINT) {
DEBUG_uart_print_str("EPS->OBC DATA (no tags): ");
DEBUG_uart_print_array_hex(rx_buf, rx_buf_len, "\n");
DEBUG_uart_print_array_hex(rx_buf, rx_buf_len);
DEBUG_uart_print_str("\n");
}

// Check STAT field (Table 3-11) - 0x00 and 0x80 mean success
Expand Down
4 changes: 2 additions & 2 deletions firmware/Core/Src/telecommands/eps_telecommands.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/// @brief Triggers the EPS watchdog. No args.
/// @return 0 on success, 1 on failure.
uint8_t TCMDEXEC_eps_watchdog(const uint8_t *args_str, TCMD_TelecommandChannel_enum_t tcmd_channel,
uint8_t TCMDEXEC_eps_watchdog(const char *args_str, TCMD_TelecommandChannel_enum_t tcmd_channel,
char *response_output_buf, uint16_t response_output_buf_len) {

const uint8_t result = EPS_CMD_watchdog();
Expand All @@ -26,7 +26,7 @@ uint8_t TCMDEXEC_eps_watchdog(const uint8_t *args_str, TCMD_TelecommandChannel_e

/// @brief Gets the EPS system status, and returns it as a JSON string.
/// @return 0 on success, >0 on failure.
uint8_t TCMDEXEC_eps_get_system_status_json(const uint8_t *args_str,
uint8_t TCMDEXEC_eps_get_system_status_json(const char *args_str,
TCMD_TelecommandChannel_enum_t tcmd_channel,
char *response_output_buf, uint16_t response_output_buf_len) {

Expand Down

0 comments on commit 13edf46

Please sign in to comment.