Common Support Functions: Implementation More...
#include "..\includes.h"
Macros | |
#define | INC_COMMON |
#define | COMMON_PROGRAM_HALTED CommonMessages[0] |
#define | COMMON_EXIT CommonMessages[1] |
#define | COMMON_BUFFER_OVERFLOW CommonMessages[1] |
Functions | |
void | config_std_output (void *output) |
configure standard output stream More... | |
void | PrintExitCode (void) |
Show a descriptive error message on exit. More... | |
void | AppInit (uint32_t dsp_clock) |
Initialize application. More... | |
void | AppCleanup (void) |
Disable interrupts, DMA, timer etc. More... | |
uint32_t | progress (uint32_t done, uint32_t left, uint32_t bad) |
char * | num2str (int32_t num, char *buffer, int32_t min, int hexmode) |
convert a 32bit integer to string More... | |
_CODE_ACCESS void | memmap (uint32_t heap_mem_size) |
show current dynamic memory allocation map More... | |
uint32_t | GetFreeHeapSize (void) |
determine free heap size More... | |
Variables | |
const char * | FRMessages [] |
uint32_t | exit_code = UINT32_C(0) |
const char * | exit_string = NULL |
char * | exit_file = NULL |
uint32_t | exit_line = UINT32_C(0) |
const char * | CommonMessages [] |
uint32_t | initial_heap_size = UINT32_C(0) |
static tpOutputFunc | _out_stream =printf |
_ _ _ __| | ___(_) ____ _ __ | |_ / _` | / __| |/ _` | '_ \| __| | (_| | _ \__ \ | (_| | | | | |_ \__,_|(_) ___/_|\__, |_| |_|\__| Signalprocessing |___/ Technology
This module contains common support functions for application start-up, clean-up on exit, descriptive error and exit strings, LED signalling.
#define INC_COMMON |
#define COMMON_PROGRAM_HALTED CommonMessages[0] |
#define COMMON_EXIT CommonMessages[1] |
#define COMMON_BUFFER_OVERFLOW CommonMessages[1] |
void config_std_output | ( | void * | output | ) |
output | - new output stream |
void PrintExitCode | ( | void | ) |
- |
Print descriptive exit message. This function uses global pointer to exit string. Exit string is set by function prg_exit()
void AppInit | ( | uint32_t | dsp_clock | ) |
dsp_clock | [Hz] |
Application Initialization Code
Put all your initialization code into this central function. To make the CPrintf() function work as well in your initialization code called from here CPrintf_select_output() should be moved here too.
void AppCleanup | ( | void | ) |
- |
Application Cleanup Code at exit
This function is called on exit to cleanup running processes like interrupts and DMA, flush opened files, close handles
num | - number to convert |
*buffer | - pointer to string buffer |
min | - reserved number of digits in string, 0 means automatic |
hexmode | - 1: switch to hex mode |
_CODE_ACCESS void memmap | ( | uint32_t | heap_mem_size | ) |
This function is useful to show memory fragmentation and to detect memory leaks
heap_mem_size | - configured heap size |
uint32_t GetFreeHeapSize | ( | void | ) |
This function determines the largest free heap block
- |
const char* FRMessages[] |
function return messages
exit codes => system error codes to signal fatal errors
const char* exit_string = NULL |
exit string => global variable set in prg_exit() to the current exit message
char* exit_file = NULL |
exit file => global variable set in prg_exit() to the current exit file
exit line => global variable set in prg_exit() to the current exit line
const char* CommonMessages[] |
|
static |