Weather casting with Machine Learning (SVM and SRNN).

Dependencies:   EthernetInterface GraphicHandler NTPClient SRNN SVM SensorModule mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers debug.cpp Source File

debug.cpp

00001 #include "debug.hpp"
00002 
00003 void print_mat_func(float* mat, int row, int col)
00004 {
00005     for (int i = 0; i < row; i++) {
00006         for (int j = 0; j < col; j++) {
00007             if (j == 0) {
00008                 printf("|");
00009             }
00010             float val = MATRIX_AT(mat,col,i,j);
00011             if (val > 0) {
00012                 printf(" ");
00013             }
00014             printf("%3.3f ",val);
00015             if (j == col-1) {
00016                 printf("| \r\n");
00017             };
00018         }
00019     }
00020 }
00021 
00022 void print_vec_func(float* vec, int dim)
00023 {
00024     for (int i = 0; i < dim; i++) {
00025         printf("%f ", vec[i]);
00026     }
00027     printf("\r\n");
00028 }
00029 
00030 void no_memory(void)
00031 {
00032     error("panic: can't allocate to memory! \r\n");
00033     while(1);
00034 }
00035 
00036 extern "C" {
00037 
00038 void HardFault_Handler(void)
00039 {
00040     error("Hard Fault! \r\n");
00041     while(1);
00042 }
00043 
00044 void MemManage_Handler(void)
00045 {
00046     error("MemManage Fault!\n");
00047     while(1);
00048 }
00049 
00050 void BusFault_Handler()
00051 {
00052     error("BusFault Fault!\r\n");
00053     while(1);
00054 }
00055 
00056 void UsageFault_Handler()
00057 {
00058     error("Usage Fault!\r\n");
00059     while(1);
00060 }
00061 
00062 }