diff --git a/right/src/usb_commands/usb_command_get_debug_info.c b/right/src/usb_commands/usb_command_get_debug_buffer.c similarity index 71% rename from right/src/usb_commands/usb_command_get_debug_info.c rename to right/src/usb_commands/usb_command_get_debug_buffer.c index 502f909..de7561e 100644 --- a/right/src/usb_commands/usb_command_get_debug_info.c +++ b/right/src/usb_commands/usb_command_get_debug_buffer.c @@ -1,19 +1,19 @@ #include "fsl_i2c.h" -#include "usb_command_get_debug_info.h" +#include "usb_command_get_debug_buffer.h" #include "usb_protocol_handler.h" #include "slave_scheduler.h" #include "i2c_watchdog.h" -uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH]; +uint8_t DebugBuffer[USB_GENERIC_HID_OUT_BUFFER_LENGTH]; -void UsbCommand_GetDebugInfo(void) +void UsbCommand_GetDebugBuffer(void) { SET_DEBUG_BUFFER_UINT32(1, I2C_Watchdog); SET_DEBUG_BUFFER_UINT32(5, I2cSchedulerCounter); SET_DEBUG_BUFFER_UINT32(9, I2cWatchdog_OuterCounter); SET_DEBUG_BUFFER_UINT32(13, I2cWatchdog_InnerCounter); - memcpy(GenericHidOutBuffer, UsbDebugInfo, USB_GENERIC_HID_OUT_BUFFER_LENGTH); + memcpy(GenericHidOutBuffer, DebugBuffer, USB_GENERIC_HID_OUT_BUFFER_LENGTH); /* uint64_t ticks = microseconds_get_ticks(); uint32_t microseconds = microseconds_convert_to_microseconds(ticks); diff --git a/right/src/usb_commands/usb_command_get_debug_buffer.h b/right/src/usb_commands/usb_command_get_debug_buffer.h new file mode 100644 index 0000000..72e195e --- /dev/null +++ b/right/src/usb_commands/usb_command_get_debug_buffer.h @@ -0,0 +1,22 @@ +#ifndef __USB_COMMAND_GET_DEBUG_BUFFER_H__ +#define __USB_COMMAND_GET_DEBUG_BUFFER_H__ + +// Includes: + + #include "usb_interfaces/usb_interface_generic_hid.h" + +// Macros: + + #define SET_DEBUG_BUFFER_UINT8(offset, value) (*(uint8_t*)(DebugBuffer+(offset)) = (value)) + #define SET_DEBUG_BUFFER_UINT16(offset, value) (*(uint16_t*)(DebugBuffer+(offset)) = (value)) + #define SET_DEBUG_BUFFER_UINT32(offset, value) (*(uint32_t*)(DebugBuffer+(offset)) = (value)) + +// Variables: + + extern uint8_t DebugBuffer[USB_GENERIC_HID_OUT_BUFFER_LENGTH]; + +// Functions: + + void UsbCommand_GetDebugBuffer(void); + +#endif diff --git a/right/src/usb_commands/usb_command_get_debug_info.h b/right/src/usb_commands/usb_command_get_debug_info.h deleted file mode 100644 index e2000df..0000000 --- a/right/src/usb_commands/usb_command_get_debug_info.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __USB_COMMAND_GET_DEBUG_INFO_H__ -#define __USB_COMMAND_GET_DEBUG_INFO_H__ - -// Includes: - - #include "usb_interfaces/usb_interface_generic_hid.h" - -// Macros: - - #define SET_DEBUG_BUFFER_UINT8(offset, value) (*(uint8_t*)(UsbDebugInfo+(offset)) = (value)) - #define SET_DEBUG_BUFFER_UINT16(offset, value) (*(uint16_t*)(UsbDebugInfo+(offset)) = (value)) - #define SET_DEBUG_BUFFER_UINT32(offset, value) (*(uint32_t*)(UsbDebugInfo+(offset)) = (value)) - -// Variables: - - extern uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH]; - -// Functions: - - void UsbCommand_GetDebugInfo(void); - -#endif diff --git a/right/src/usb_protocol_handler.c b/right/src/usb_protocol_handler.c index ff84207..94f79f3 100644 --- a/right/src/usb_protocol_handler.c +++ b/right/src/usb_protocol_handler.c @@ -9,7 +9,7 @@ #include "usb_commands/usb_command_launch_eeprom_transfer_legacy.h" #include "usb_commands/usb_command_read_config.h" #include "usb_commands/usb_command_get_keyboard_state.h" -#include "usb_commands/usb_command_get_debug_info.h" +#include "usb_commands/usb_command_get_debug_buffer.h" #include "usb_commands/usb_command_jump_to_slave_bootloader.h" #include "usb_commands/usb_command_send_kboot_command.h" @@ -55,7 +55,7 @@ void UsbProtocolHandler(void) UsbCommand_GetKeyboardState(); break; case UsbCommandId_GetDebugInfo: - UsbCommand_GetDebugInfo(); + UsbCommand_GetDebugBuffer(); break; case UsbCommandId_JumpToSlaveBootloader: UsbCommand_JumpToSlaveBootloader();