First release

Dependencies:   CreaBotLib LED_WS2812 MotorLib X_NUCLEO_6180XA1 mbed

Crealab.h

Committer:
alcocerg
Date:
2018-09-24
Revision:
1:3589e8f6e99c
Parent:
0:1f59690eebe2

File content as of revision 1:3589e8f6e99c:

#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;};