Add and use SET_DEBUG_BUFFER_UINT*
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "fsl_i2c.h"
|
||||
#include "usb_command_get_debug_info.h"
|
||||
#include "usb_protocol_handler.h"
|
||||
#include "slave_scheduler.h"
|
||||
#include "i2c_watchdog.h"
|
||||
@@ -7,10 +8,10 @@ uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||
|
||||
void UsbCommand_GetDebugInfo(void)
|
||||
{
|
||||
*(uint32_t*)(UsbDebugInfo+1) = I2C_Watchdog;
|
||||
*(uint32_t*)(UsbDebugInfo+5) = I2cSchedulerCounter;
|
||||
*(uint32_t*)(UsbDebugInfo+9) = I2cWatchdog_OuterCounter;
|
||||
*(uint32_t*)(UsbDebugInfo+13) = I2cWatchdog_InnerCounter;
|
||||
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);
|
||||
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
|
||||
#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];
|
||||
|
||||
Reference in New Issue
Block a user