diff options
author | Paul Selkirk <paul@psgd.org> | 2015-11-02 18:46:16 -0500 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2015-11-02 18:46:16 -0500 |
commit | 0306ce3add02dbe28826f687f86c2c2fae53354c (patch) | |
tree | c430c9cd7fe0c2e0315d4bb52982c14cc5b4dbd1 /include | |
parent | 5704540e425105d3bfa5ebc378743d7ea8adf46a (diff) |
rewrite and unify uart_send_<numbertype>
Diffstat (limited to 'include')
-rw-r--r-- | include/stm-uart.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/stm-uart.h b/include/stm-uart.h index 62b2efd..c57afd5 100644 --- a/include/stm-uart.h +++ b/include/stm-uart.h @@ -9,8 +9,9 @@ extern void MX_USART2_UART_Init(void); extern void uart_send_char(uint8_t ch); extern void uart_send_string(char *s); -extern void uart_send_binary(uint32_t num, uint8_t bits); -extern void uart_send_integer(uint32_t data, uint32_t mag); -extern void uart_send_hex(uint32_t num, uint8_t digits); +extern void uart_send_number(uint32_t num, uint8_t digits, uint8_t radix); +#define uart_send_binary(num, bits) uart_send_number(num, bits, 2) +#define uart_send_integer(num, digits) uart_send_number(num, digits, 10) +#define uart_send_hex(num, digits) uart_send_number(num, digits, 16) #endif /* __STM32_DEV_BRIDGE_UART_H */ |