Replace SET_DEBUG_BUFFER_UINT* macros with SetDebugBufferUint* functions for improved type safety and readability.
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
#include "usb_protocol_handler.h"
|
||||
#include "slave_scheduler.h"
|
||||
#include "i2c_watchdog.h"
|
||||
#include "buffer.h"
|
||||
|
||||
uint8_t DebugBuffer[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||
|
||||
void UsbCommand_GetDebugBuffer(void)
|
||||
{
|
||||
SET_DEBUG_BUFFER_UINT32(1, I2C_Watchdog);
|
||||
SET_DEBUG_BUFFER_UINT32(5, I2cSlaveScheduler_Counter);
|
||||
SET_DEBUG_BUFFER_UINT32(9, I2cWatchdog_WatchCounter);
|
||||
SET_DEBUG_BUFFER_UINT32(13, I2cWatchdog_RecoveryCounter);
|
||||
SetDebugBufferUint32(1, I2C_Watchdog);
|
||||
SetDebugBufferUint32(5, I2cSlaveScheduler_Counter);
|
||||
SetDebugBufferUint32(9, I2cWatchdog_WatchCounter);
|
||||
SetDebugBufferUint32(13, I2cWatchdog_RecoveryCounter);
|
||||
|
||||
memcpy(GenericHidOutBuffer, DebugBuffer, USB_GENERIC_HID_OUT_BUFFER_LENGTH);
|
||||
|
||||
@@ -21,3 +22,18 @@ void UsbCommand_GetDebugBuffer(void)
|
||||
*(uint32_t*)(GenericHidOutBuffer+1) = ticks;
|
||||
*/
|
||||
}
|
||||
|
||||
void SetDebugBufferUint8(uint32_t offset, uint8_t value)
|
||||
{
|
||||
SetBufferUint8(DebugBuffer, offset, value);
|
||||
}
|
||||
|
||||
void SetDebugBufferUint16(uint32_t offset, uint16_t value)
|
||||
{
|
||||
SetBufferUint16(DebugBuffer, offset, value);
|
||||
}
|
||||
|
||||
void SetDebugBufferUint32(uint32_t offset, uint32_t value)
|
||||
{
|
||||
SetBufferUint32(DebugBuffer, offset, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user