Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface GraphicHandler NTPClient SRNN SVM SensorModule mbed-rtos mbed
debug/debug.cpp@0:f6cdb984f638, 2015-02-15 (annotated)
- Committer:
- yukari_hinata
- Date:
- Sun Feb 15 09:28:23 2015 +0000
- Revision:
- 0:f6cdb984f638
modified (add setup modules)
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yukari_hinata | 0:f6cdb984f638 | 1 | #include "debug.hpp" |
| yukari_hinata | 0:f6cdb984f638 | 2 | |
| yukari_hinata | 0:f6cdb984f638 | 3 | void print_mat_func(float* mat, int row, int col) { |
| yukari_hinata | 0:f6cdb984f638 | 4 | for (int i = 0; i < row; i++) { |
| yukari_hinata | 0:f6cdb984f638 | 5 | for (int j = 0; j < col; j++) { |
| yukari_hinata | 0:f6cdb984f638 | 6 | if (j == 0) { printf("|"); } |
| yukari_hinata | 0:f6cdb984f638 | 7 | float val = MATRIX_AT(mat,col,i,j); |
| yukari_hinata | 0:f6cdb984f638 | 8 | if (val > 0) { printf(" "); } |
| yukari_hinata | 0:f6cdb984f638 | 9 | printf("%3.3f ",val); |
| yukari_hinata | 0:f6cdb984f638 | 10 | if (j == col-1) { printf("| \r\n"); }; |
| yukari_hinata | 0:f6cdb984f638 | 11 | } |
| yukari_hinata | 0:f6cdb984f638 | 12 | } |
| yukari_hinata | 0:f6cdb984f638 | 13 | } |
| yukari_hinata | 0:f6cdb984f638 | 14 | |
| yukari_hinata | 0:f6cdb984f638 | 15 | void print_vec_func(float* vec, int dim) { |
| yukari_hinata | 0:f6cdb984f638 | 16 | for (int i = 0; i < dim; i++) { |
| yukari_hinata | 0:f6cdb984f638 | 17 | printf("%f ", vec[i]); |
| yukari_hinata | 0:f6cdb984f638 | 18 | } |
| yukari_hinata | 0:f6cdb984f638 | 19 | printf("\r\n"); |
| yukari_hinata | 0:f6cdb984f638 | 20 | } |
| yukari_hinata | 0:f6cdb984f638 | 21 | |
| yukari_hinata | 0:f6cdb984f638 | 22 | void no_memory(void) { |
| yukari_hinata | 0:f6cdb984f638 | 23 | fprintf( stderr, "panic: can't allocate to memory! \r\n"); |
| yukari_hinata | 0:f6cdb984f638 | 24 | exit(1); |
| yukari_hinata | 0:f6cdb984f638 | 25 | } |