Replace SET_DEBUG_BUFFER_UINT* macros with SetDebugBufferUint* functions for improved type safety and readability.

This commit is contained in:
László Monda
2017-11-11 03:52:39 +01:00
parent 5c7a3faa9c
commit f4de0df149
3 changed files with 30 additions and 15 deletions

View File

@@ -5,12 +5,6 @@
#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];
@@ -19,4 +13,8 @@
void UsbCommand_GetDebugBuffer(void);
void SetDebugBufferUint8(uint32_t offset, uint8_t value);
void SetDebugBufferUint16(uint32_t offset, uint16_t value);
void SetDebugBufferUint32(uint32_t offset, uint32_t value);
#endif