First release
Dependencies: CreaBotLib LED_WS2812 MotorLib X_NUCLEO_6180XA1 mbed
Diff: Crealab.h
- Revision:
- 0:1f59690eebe2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Crealab.h Wed Sep 19 14:20:26 2018 +0000 @@ -0,0 +1,36 @@ +#include "mbed.h" +#include "CreaBot.h" +#include "LED_WS2812.h" + +// --- USB Debug Port ----------- + +/* #define DEBUG_BT_PC 3 +#define DEBUG_PC 2 +#define DEBUG_BT 1 +#define NO_DEBUG 0 + +#ifndef DEBUG_MODE +#define DEBUG_MODE NO_DEBUG +#endif + +#if (DEBUG_MODE == DEBUG_PC) +#define DEBUG(...) { pc_uart.printf(__VA_ARGS__); } +#elif (DEBUG_MODE == DEBUG_BT) +#define DEBUG(...) { bt_uart.printf(__VA_ARGS__); } +#elif (DEBUG_MODE == DEBUG_BT_PC) +DEBUG("Debug Mode: NT & PC \n\r"); +#define DEBUG(...) { bt_uart.printf(__VA_ARGS__); pc_uart.printf(__VA_ARGS__);} +#else +#define DEBUG(...) +#endif */ + + +// #define DEBUG(...) { pc_uart.printf(__VA_ARGS__); bt_uart.printf(__VA_ARGS__);} +#define DEBUG(...) { __disable_irq(); pc_uart.printf(__VA_ARGS__);__enable_irq();} +// #define DEBUG(...) { bt_uart.printf(__VA_ARGS__); } + +#define CATCH_BUTTON(button, func) button.fall(&func) + +#define CASE(letter, text, commands) case letter: if(flaghelp) DEBUG("\t%c : %s\n\r", letter,text);if(!flaghelp) {commands;break;}; + +