Press buttons to activate the LED.
Dependencies: BLE_API nRF51822
Fork of Puck by
Diff: Puck.h
- Revision:
- 7:c07c01c2a741
- Parent:
- 6:211ffef3b88e
- Child:
- 8:49ffd38fb401
- Child:
- 9:ba0527c6b6d0
diff -r 211ffef3b88e -r c07c01c2a741 Puck.h --- a/Puck.h Wed Jul 23 14:34:21 2014 +0000 +++ b/Puck.h Thu Jul 24 09:25:42 2014 +0000 @@ -3,62 +3,7 @@ #include "BLEDevice.h" #include <vector> - - -#ifdef LOG_LEVEL_VERBOSE - #define __PUCK_LOG_LEVEL_VERBOSE__ -#endif -#ifdef LOG_LEVEL_DEBUG - #define __PUCK_LOG_LEVEL_DEBUG__ -#endif -#ifdef LOG_LEVEL_INFO - #define __PUCK_LOG_LEVEL_INFO__ -#endif -#ifdef LOG_LEVEL_WARN - #define __PUCK_LOG_LEVEL_WARN__ -#endif -#ifdef LOG_LEVEL_ERROR - #define __PUCK_LOG_LEVEL_ERROR__ -#endif - -#ifdef __PUCK_LOG_LEVEL_VERBOSE__ - #define LOG_VERBOSE(fmt, ...) do { logger.printf("[V] "); logger.printf(fmt, ##__VA_ARGS__); } while(0) - #define __PUCK_LOG_LEVEL_DEBUG__ -#else - #define LOG_VERBOSE(fmt, ...) -#endif - -#ifdef __PUCK_LOG_LEVEL_DEBUG__ - #define LOG_DEBUG(fmt, ...) do { logger.printf("[D] "); logger.printf(fmt, ##__VA_ARGS__); } while(0) - #define __PUCK_LOG_LEVEL_INFO__ -#else - #define LOG_DEBUG(fmt, ...) -#endif - -#ifdef __PUCK_LOG_LEVEL_INFO__ - #define LOG_INFO(fmt, ...) do { logger.printf("[I] "); logger.printf(fmt, ##__VA_ARGS__); } while(0) - #define __PUCK_LOG_LEVEL_WARN__ -#else - #define LOG_INFO(fmt, ...) -#endif - -#ifdef __PUCK_LOG_LEVEL_WARN__ - #define LOG_WARN(fmt, ...) do { logger.printf("![W] "); logger.printf(fmt, ##__VA_ARGS__); } while(0) - #define __PUCK_LOG_LEVEL_ERROR__ -#else - #define LOG_WARN(fmt, ...) -#endif - -#ifdef __PUCK_LOG_LEVEL_ERROR__ - #define LOG_ERROR(fmt, ...) do { logger.printf("!![E] "); logger.printf(fmt, ##__VA_ARGS__); } while(0) -#else - #define LOG_ERROR(fmt, ...) -#endif - -#ifdef __PUCK_LOG_LEVEL_ERROR__ - Serial logger(USBTX, USBRX); -#endif - +#include "Log.h" enum PuckState { CONNECTING,