#define CPU_CLOCK_MHZ 72
+// Debugging port
+
+// #define DEBUG_SEMIHOSTING
+#define DEBUG_USART USART1
+
// MODBUS library parameters
#define MODBUS_USART USART2
* (c) 2019 Martin Mareš <mj@ucw.cz>
*/
-#include "config.h"
#include "util.h"
#include "modbus.h"
#include <stdarg.h>
#include <string.h>
+/*** Configuration ***/
+
+// You should set the following parameters in config.h
+
+// Use the semi-hosting interface for debugging messages
+// #define DEBUG_SEMIHOSTING
+
+// Use this USART for debugging messages
+// #define DEBUG_USART USART1
+
+/*** Implementation ***/
+
#ifdef DEBUG_SEMIHOSTING
void semi_put_char(char c)
#include <stddef.h>
#include <stdint.h>
+#include "config.h"
+
typedef unsigned int uint;
typedef uint8_t byte;
typedef uint16_t u16;
// debug.c
-// #define DEBUG_SEMIHOSTING
-#define DEBUG_USART USART1
-
void debug_printf(const char *fmt, ...);
void debug_puts(const char *s);
void debug_putc(int c);