Nordic Semiconductor nRF5 AirFuel SDK
version 2.2.0
|
Source file for PTU UART test interface. More...
#include <string.h>
#include <stdio.h>
#include "app_print.h"
#include "simple_uart.h"
#include "ptu_test_mux.h"
#include "ptu_registry.h"
#include "ptu_sensors.h"
#include "bsp.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_LINE_LENGTH 80 |
#define | EVT_STRING_LENGTH_MAX 20 |
#define | VTX_INCREMENT 1000 |
#define | ITX_INCREMENT 100 |
#define | TEMPERATURE_INCREMENT 10 |
#define | EXTENDED_BEACON_THRESHOLD_MS 500 |
#define | MAX_RTC_COUNTER_VAL 0x00FFFFFF |
Functions | |
API implementation | |
bool | ptu_process_command_board (uint8_t cmd) |
Function for processing board related test commands. More... | |
void | sm_uart_rx_poll (void) |
Get and process uart commands. | |
void | line_print (void) |
Print a DEBUG_LINE_LENGTH character long "horizontal line" to UART. | |
static bool | debug_output_changed (void) |
Update m_debug_output variable. More... | |
static void | debug_output_print (void) |
Print contents of m_debug_output to UART. More... | |
void | debug (void) |
Process debug commands. | |
void | debug_add_string (const char *s) |
Add string to debug output. More... | |
Static functions and variables | |
static debug_output_t | m_debug_output |
static char | m_evt_evt_string [EVT_STRING_LENGTH_MAX] = "" |
static ptu_tmux_override_t | override_values |
static bool | m_uart_initialized = false |
static bool | m_simplified_beacon_print = false |
static bool | force_debug_print = false |
static void | m_set_load_variation_detected (void) |
Will syntesize a load representing a load variation to the sensors module. This will be set to true for 1.5 seconds. | |
static char * | sm_state_string_get (ptu_sm_state_t state) |
Convert state to string. More... | |
static bool | m_uart_chars_available (void) |
Check if there are any characters in the UART receive buffer. More... | |
static bool | m_ptu_process_command_common (uint8_t cmd) |
Function for processing common test commands. More... | |
static uint32_t | ms_since (uint32_t tick) |
Function for getting the time, in ms, that have passed since the argument system tick. More... | |
Source file for PTU UART test interface.
Definition in file ptu_debug.c.
#define DEBUG_LINE_LENGTH 80 |
Width of debug output table
Definition at line 29 of file ptu_debug.c.
#define EVT_STRING_LENGTH_MAX 20 |
Max length of event message string
Definition at line 30 of file ptu_debug.c.
#define VTX_INCREMENT 1000 |
Value by which the Vtx is incremented/decremented for each call to the simulated measurement function.
Definition at line 31 of file ptu_debug.c.
#define ITX_INCREMENT 100 |
Value by which the Itx is incremented/decremented for each call to the simulated measurement function.
Definition at line 32 of file ptu_debug.c.
#define TEMPERATURE_INCREMENT 10 |
Value by which the Temperature is incremented/decremented for each call to the simulated measurement function.
Definition at line 33 of file ptu_debug.c.
#define EXTENDED_BEACON_THRESHOLD_MS 500 |
The amount of time a beacon lasts before the debug functionality determines it is an extended beacon.
Definition at line 34 of file ptu_debug.c.
#define MAX_RTC_COUNTER_VAL 0x00FFFFFF |
Maximum value of the RTC counter.
Definition at line 35 of file ptu_debug.c.
|
static |
Convert state to string.
state | The state to translate |
Definition at line 97 of file ptu_debug.c.
|
static |
Check if there are any characters in the UART receive buffer.
This function returns the true if there is a character available for reading in the UART receive buffer.
Definition at line 125 of file ptu_debug.c.
|
static |
Function for processing common test commands.
[in] | cmd | Command code to process. |
true | Command code was processed by this function. |
false | Command code was not processed by this function. |
Definition at line 138 of file ptu_debug.c.
|
static |
Function for getting the time, in ms, that have passed since the argument system tick.
[in] | tick | System tick we are measureing time from. |
Time,in | ms, that have passes since the argument system tick. |
Definition at line 300 of file ptu_debug.c.
bool ptu_process_command_board | ( | uint8_t | cmd | ) |
Function for processing board related test commands.
[in] | cmd | Command code to process. |
true | Command code was processed by this function. |
false | Command code was not processed by this function. |
|
static |
Update m_debug_output variable.
Definition at line 377 of file ptu_debug.c.
|
static |
Print contents of m_debug_output to UART.
< Debug output collection
Definition at line 494 of file ptu_debug.c.
|
static |
Debug output collection
Definition at line 55 of file ptu_debug.c.
|
static |
Event message string
Definition at line 56 of file ptu_debug.c.
|
static |
Local copy of override values
Definition at line 57 of file ptu_debug.c.
|
static |
UART initalized flag. Used to initialize UART on first scharacter sent.
Definition at line 58 of file ptu_debug.c.
|
static |
Simplify print flag. Used to decide if beacon debug data should be short.
Definition at line 59 of file ptu_debug.c.
|
static |
Flag to force debug print even though debug information has not changed.
Definition at line 60 of file ptu_debug.c.