Weather casting with Machine Learning (SVM and SRNN).
Dependencies: EthernetInterface GraphicHandler NTPClient SRNN SVM SensorModule mbed-rtos mbed
Diff: debug/debug.hpp
- Revision:
- 0:f6cdb984f638
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debug/debug.hpp Sun Feb 15 09:28:23 2015 +0000 @@ -0,0 +1,30 @@ +#ifndef DEBUG_H_INCLUDED +#define DEBUG_H_INCLUDED + +#include "mbed.h" +#include <new> + +#include "../util/util.hpp" + +// Debug Macros +#define DBG(...) printf("" __VA_ARGS__) +#define PRINT_INT(x) (printf(#x " : %d \r\n", x)) +#define PRINT_FLT(x) (printf(#x " : %f \r\n", x)) + +#define PRINT_VEC(vec,dim) (printf("FILE[%s] LINE %d, %s: \r\n", __FILE__, __LINE__, (#vec)) \ + (print_vec_func((vec),(dim))) +#define PRINT_MAT(mat,row,col) (printf("FILE[%s] LINE %d, %s: \r\n", __FILE__, __LINE__, (#mat)) \ + (print_vec_func((vec),(row),(col))) + +// Debug Modules + +void print_vec_func(float* vec, int dim); + +void print_mat_func(float* mat, int row, int col); + +void write_log(char* name, ...); + +void no_memory(void); // error handler for memory allocate failing + +#endif /* DEBUG_H_INCLUDED */ +