-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.cpp
More file actions
executable file
·40 lines (31 loc) · 800 Bytes
/
debug.cpp
File metadata and controls
executable file
·40 lines (31 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "debug.h"
#include "defs.h"
#include "debug_defs.h"
#define __PROG_TYPES_COMPAT__
#include <avr/pgmspace.h>
#include <EEPROM.h>
#include <SPI.h>
char line[ 24 ];
int freeRAM()
{
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
void dumpSettings()
{
strncpy_P( line, (char*)pgm_read_word(&(DBG_STRS[ 0 ])), 24 );
Serial.println( line );
strncpy_P( line, (char*)pgm_read_word(&(DBG_STRS[ 1 ])), 24 );
// Auto cal values
Serial.print( line );
Serial.println( EEPROM.read( MOTOR_VALS_ADDR ), HEX );
}
void printFirmwareInfo()
{
for( uint8_t i = 2 ; i < 4 ; ++i )
{
strncpy_P( line, (char*)pgm_read_word(&(DBG_STRS[ i ])), 24 );
Serial.println( line );
}
}