OneWay  3.0-3-ge9d4fa4
Functions
debug.c File Reference

printing to terminal functions. More...

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <avr/io.h>
#include <util/delay.h>
#include "debug.h"
Include dependency graph for debug.c:

Functions

void debug_print_P (PGM_P string, struct debug_t *debug)
 
void debug_print (struct debug_t *debug)
 
uint8_t debug_wait_for_y (struct debug_t *debug)
 press 'y' or 'n' More...
 
struct debug_tdebug_init (void)
 initialize debug struct and uart console
 
void debug_free (struct debug_t *debug)
 free the memory
 
void debug_print_htv (struct htv_t *htv, struct debug_t *debug)
 print the struct htv contents. More...
 
void debug_print_address (struct htv_t *htv, struct debug_t *debug)
 print the RX address in use.
 
void debug_setup_address (struct htv_t *htv, struct debug_t *debug)
 input and store the address of the unit in EEPROM. More...
 

Detailed Description

printing to terminal functions.

Function Documentation

◆ debug_print()

void debug_print ( struct debug_t debug)

print the debug->line if debug is active.

◆ debug_print_htv()

void debug_print_htv ( struct htv_t htv,
struct debug_t debug 
)

print the struct htv contents.

Note
if the strings are not correctly initialized and terminated, this function will memory leak and crash.

◆ debug_print_P()

void debug_print_P ( PGM_P  string,
struct debug_t debug 
)

Print a string taken directly from the EEPROM avoiding memory allocation.

Parameters
stringthe PSTR() string to be printed.
debugthe struct debug.

◆ debug_setup_address()

void debug_setup_address ( struct htv_t htv,
struct debug_t debug 
)

input and store the address of the unit in EEPROM.

Note
the function will cycle until a correct address is entered.

◆ debug_wait_for_y()

uint8_t debug_wait_for_y ( struct debug_t debug)

press 'y' or 'n'

"Y" is 89 and "y" is 121

Exit the cicle in a bad way