Press buttons to activate the LED.
Dependencies: BLE_API nRF51822
Fork of Puck by
Log.h
- Committer:
- cristea
- Date:
- 2014-08-05
- Revision:
- 12:8a8cc109f048
- Parent:
- 7:c07c01c2a741
- Child:
- 25:cd6703df9501
File content as of revision 12:8a8cc109f048:
/** * Copyright 2014 Nordic Semiconductor * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ #ifndef __LOG__H__ #define __LOG__H__ #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__ static Serial logger(USBTX, USBRX); #endif #endif //__LOG__H__