Data Structures | |
struct | mbng_file_r_info_t |
union | mbng_file_r_req_t |
struct | mbng_file_r_var_t |
union | mbng_file_r_item_id_t |
Defines | |
#define | DEBUG_VERBOSE_LEVEL 1 |
#define | DEBUG_FILE_HANDLER_PERFORMANCE 0 |
#define | NGR_TOKENIZED 0 |
#define | IF_MAX_NESTING_LEVEL 16 |
#define | MBNG_FILES_PATH "/" |
Enumerations | |
enum | ngr_token_t { TOKEN_NOP = 0, TOKEN_EXIT = 0x01, TOKEN_DELAY_MS = 0x02, TOKEN_LCD = 0x03, TOKEN_LOG = 0x04, TOKEN_SEND = 0x05, TOKEN_EXEC_META = 0x06, TOKEN_SET = 0x07, TOKEN_CHANGE = 0x08, TOKEN_TRIGGER = 0x09, TOKEN_SET_RGB = 0x0a, TOKEN_SET_HSV = 0x0b, TOKEN_SET_LOCK = 0x0c, TOKEN_SET_ACTIVE = 0x0d, TOKEN_SET_NO_DUMP = 0x0e, TOKEN_SET_MIN = 0x0f, TOKEN_SET_MAX = 0x10, TOKEN_IF = 0x80, TOKEN_ELSE = 0x81, TOKEN_ELSEIF = 0x82, TOKEN_ENDIF = 0x84, TOKEN_COND_EQ = 0x90, TOKEN_COND_NE = 0x91, TOKEN_COND_GTEQ = 0x92, TOKEN_COND_LTEQ = 0x93, TOKEN_COND_GT = 0x94, TOKEN_COND_LT = 0x95 } |
Functions | |
s32 | MBNG_FILE_R_Init (u32 mode) |
s32 | MBNG_FILE_R_Load (char *filename) |
s32 | MBNG_FILE_R_Unload (void) |
s32 | MBNG_FILE_R_Valid (void) |
s32 | MBNG_FILE_R_TokenizedNgrSet (u8 enable) |
s32 | MBNG_FILE_R_TokenizedNgrGet (void) |
s32 | MBNG_FILE_R_TokenMemPrint (void) |
s32 | MBNG_FILE_R_VarSectionSet (u8 section) |
s32 | MBNG_FILE_R_VarSectionGet () |
s32 | MBNG_FILE_R_VarValueSet (u8 value) |
s32 | MBNG_FILE_R_VarValueGet () |
s32 | lineIsEmpty (char *line) |
s32 | parseCondition (u32 line, char *command, char **brkt, u8 tokenize_req) |
s32 | sendTokenized (mios32_midi_port_t port, mbng_event_type_t event_type, u8 *stream, u32 stream_size) |
s32 | parseSend (u32 line, char *command, char **brkt, u8 tokenize_req) |
s32 | parseExecMeta (u32 line, char *command, char **brkt, u8 tokenize_req) |
s32 | setTokenizedValue (ngr_token_t token, u16 id, s32 value, s32(*exec_function)(mbng_event_item_t *item, s32 value), s32(*exec_virtual_function)(mbng_event_item_id_t id, s32 value)) |
s32 | parseCommand (u32 line, char *command, char **brkt, u8 tokenize_req, ngr_token_t command_token, s32(*exec_function)(mbng_event_item_t *item, s32 value), s32(*exec_virtual_function)(mbng_event_item_id_t id, s32 value)) |
s32 | parseDelay (u32 line, char *command, char **brkt, u8 tokenize_req) |
s32 | parseLoad (u32 line, char *command, char **brkt, char *load_filename, u8 tokenize_req) |
s32 | MBNG_FILE_R_Parser (u32 line, char *line_buffer, u8 *if_state, u8 *nesting_level, char *load_filename, u8 tokenize_req) |
s32 | MBNG_FILE_R_Exec (u8 cont_script, u8 determine_if_offsets) |
s32 | MBNG_FILE_R_Read (char *filename, u8 cont_script, u8 tokenize_req) |
s32 | MBNG_FILE_R_ReadRequest (char *filename, u8 section, s16 value, u8 notify_done) |
s32 | MBNG_FILE_R_CheckRequest (void) |
s32 | MBNG_FILE_R_RunStop (void) |
Variables | |
char | mbng_file_r_script_name [MBNG_FILE_R_FILENAME_LEN+1] |
Run File access functions
NOTE: before accessing the SD Card, the upper level function should synchronize with the SD Card semaphore! MUTEX_SDCARD_TAKE; // to take the semaphore MUTEX_SDCARD_GIVE; // to release the semaphore
#define DEBUG_FILE_HANDLER_PERFORMANCE 0 |
for performance measurements
#define DEBUG_VERBOSE_LEVEL 1 |
Include files for optional debugging messages via DEBUG_MSG (defined in mios32_config.h)
#define IF_MAX_NESTING_LEVEL 16 |
Nesting vars
#define MBNG_FILES_PATH "/" |
Local definitions
#define NGR_TOKENIZED 0 |
Tokenize the source file?
enum ngr_token_t |
s32 lineIsEmpty | ( | char * | line | ) |
Checks if line is empty (space, tab, # allowed
s32 MBNG_FILE_R_CheckRequest | ( | void | ) |
checks for a read request, should be called periodically each mS
Executes the tokenized content of a NGR file
s32 MBNG_FILE_R_Load | ( | char * | filename | ) |
Loads script Called from MBNG_FILE_RheckSDCard() when the SD card has been connected
s32 MBNG_FILE_R_Parser | ( | u32 | line, | |
char * | line_buffer, | |||
u8 * | if_state, | |||
u8 * | nesting_level, | |||
char * | load_filename, | |||
u8 | tokenize_req | |||
) |
Parses a .NGR command line
reads the config file content (again)
request to read the script file from run thread
s32 MBNG_FILE_R_RunStop | ( | void | ) |
Stops the execution of a currently running script
s32 MBNG_FILE_R_TokenizedNgrGet | ( | void | ) |
Allows to enable/disable tokenized NGR
s32 MBNG_FILE_R_TokenMemPrint | ( | void | ) |
Prints information about the token memory (used in terminal.c) returns < 0 on errors
s32 MBNG_FILE_R_Unload | ( | void | ) |
Unloads script file Called from MBNG_FILE_RheckSDCard() when the SD card has been disconnected
s32 MBNG_FILE_R_Valid | ( | void | ) |
1 if current script file valid 0 if current script file not valid
s32 MBNG_FILE_R_VarSectionGet | ( | ) |
s32 MBNG_FILE_R_VarValueGet | ( | ) |
s32 parseCommand | ( | u32 | line, | |
char * | command, | |||
char ** | brkt, | |||
u8 | tokenize_req, | |||
ngr_token_t | command_token, | |||
s32(*)(mbng_event_item_t *item, s32 value) | exec_function, | |||
s32(*)(mbng_event_item_id_t id, s32 value) | exec_virtual_function | |||
) |
help function which parses a SET command
help function which parses an IF condition
help function which parses a DELAY_MS command returns > 0 if a delay has been requested
help function which parses a EXEC_META command
help function which parses a LOAD command returns > 0 if a valid filename has been specified
help function which parses a SEND command
s32 sendTokenized | ( | mios32_midi_port_t | port, | |
mbng_event_type_t | event_type, | |||
u8 * | stream, | |||
u32 | stream_size | |||
) |
help function which executes a tokenized SEND command
s32 setTokenizedValue | ( | ngr_token_t | token, | |
u16 | id, | |||
s32 | value, | |||
s32(*)(mbng_event_item_t *item, s32 value) | exec_function, | |||
s32(*)(mbng_event_item_id_t id, s32 value) | exec_virtual_function | |||
) |
help function which SETs a value based on a token
char mbng_file_r_script_name[MBNG_FILE_R_FILENAME_LEN+1] |
Global variables