SBB Micro
Source code for the self-balancing-bike microcontroller unit (Teensy 4.1-based). 🚀️
Loading...
Searching...
No Matches
debug.h File Reference

Definitions of debug functions and variables. More...

Go to the source code of this file.

Classes

struct  TxData
 

Macros

#define DODEBUG   1
 Enable or disable debugging (1/0).
 
#define HEADER   0xFF812345
 4-bytes header of data packet.
 
#define TERMINATOR   0xFF8CABDE
 4-bytes terminator of data packet.
 
#define DEBUG_SAMPLING_FAC   10
 Sampling factor of data streaming (expressed in units of SAMPLING_TIME).
 
#define MAX_MISSING_READS   50
 Maximum consecutive missing readings.
 

Enumerations

enum  serialAction { TX_DATA = 0x01 , TX_TIME = 0x02 , TX_SIGNAMES = 0x03 }
 

Functions

void start_debug (void)
 Initialize the debug.
 
void do_debug (void)
 Stream and receive signals.
 

Variables

struct TxData txdata
 Data to transmit via Serial.
 
const int NUMSIGS = 39
 Number of signals.
 
const char SPLIT_CHAR = '\0'
 Char to split strings.
 
String signames [NUMSIGS]
 Names of the signals.
 

Detailed Description

Definitions of debug functions and variables.

File to defined the debug functions and variables. Function prototypes are in prototypes.h.

See also
Debugging prototypes.h

Enumeration Type Documentation

◆ serialAction

Enumerator
TX_DATA 
TX_TIME 
TX_SIGNAMES 

Variable Documentation

◆ NUMSIGS

const int NUMSIGS = 39

Number of signals.

◆ signames

String signames[NUMSIGS]
Initial value:
= {
"Speed", "Distance",
"Acc x", "Acc y", "Acc z",
"Gyro x", "Gyro y", "Gyro z",
"Mag x", "Mag y", "Mag z",
"Latitude", "Longitude", "GPS Speed",
"Steer angle", "Steer rate",
"Fork disp",
"Curr act",
"Steer torque",
"CPU temp", "Voltage",
"Ref input 1", "Ref input 2",
"Err state in",
"Curr ref", "Throttle",
"Roll est", "Yaw est",
"Pos est x", "Pos est y",
"Dist est", "Speed est",
"Steer angle est", "Steer rate est",
"Err state out",
"User data 1", "User data 2", "User data 3", "User data 4"
}

Names of the signals.

◆ SPLIT_CHAR

const char SPLIT_CHAR = '\0'

Char to split strings.

◆ txdata

struct TxData txdata

Data to transmit via Serial.