MBNG_FILE_R

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]

Detailed Description

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 Documentation

#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?


Enumeration Type Documentation

Enumerator:
TOKEN_NOP 
TOKEN_EXIT 
TOKEN_DELAY_MS 
TOKEN_LCD 
TOKEN_LOG 
TOKEN_SEND 
TOKEN_EXEC_META 
TOKEN_SET 
TOKEN_CHANGE 
TOKEN_TRIGGER 
TOKEN_SET_RGB 
TOKEN_SET_HSV 
TOKEN_SET_LOCK 
TOKEN_SET_ACTIVE 
TOKEN_SET_NO_DUMP 
TOKEN_SET_MIN 
TOKEN_SET_MAX 
TOKEN_IF 
TOKEN_ELSE 
TOKEN_ELSEIF 
TOKEN_ENDIF 
TOKEN_COND_EQ 
TOKEN_COND_NE 
TOKEN_COND_GTEQ 
TOKEN_COND_LTEQ 
TOKEN_COND_GT 
TOKEN_COND_LT 

Function Documentation

s32 lineIsEmpty ( char *  line  ) 

Checks if line is empty (space, tab, # allowed

Returns:
1 if line is empty
0 if line is not empty
s32 MBNG_FILE_R_CheckRequest ( void   ) 

checks for a read request, should be called periodically each mS

Returns:
< 0 on errors

Here is the call graph for this function:

s32 MBNG_FILE_R_Exec ( u8  cont_script,
u8  determine_if_offsets 
)

Executes the tokenized content of a NGR file

Returns:
< 0 on errors

Here is the call graph for this function:

s32 MBNG_FILE_R_Init ( u32  mode  ) 

Initialisation

Here is the call graph for this function:

s32 MBNG_FILE_R_Load ( char *  filename  ) 

Loads script Called from MBNG_FILE_RheckSDCard() when the SD card has been connected

Returns:
< 0 on errors

Here is the call graph for this function:

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

Returns:
< 0 on errors (error codes are documented in mbng_file.h)

Here is the call graph for this function:

s32 MBNG_FILE_R_Read ( char *  filename,
u8  cont_script,
u8  tokenize_req 
)

reads the config file content (again)

Returns:
< 0 on errors (error codes are documented in mbng_file.h)

Here is the call graph for this function:

s32 MBNG_FILE_R_ReadRequest ( char *  filename,
u8  section,
s16  value,
u8  notify_done 
)

request to read the script file from run thread

Returns:
< 0 on errors

Here is the call graph for this function:

s32 MBNG_FILE_R_RunStop ( void   ) 

Stops the execution of a currently running script

Returns:
< 0 on errors, 0 if script not running, 1 if script running (or requested)
s32 MBNG_FILE_R_TokenizedNgrGet ( void   ) 
s32 MBNG_FILE_R_TokenizedNgrSet ( u8  enable  ) 

Allows to enable/disable tokenized NGR

Here is the call graph for this function:

s32 MBNG_FILE_R_TokenMemPrint ( void   ) 

Prints information about the token memory (used in terminal.c) returns < 0 on errors

Here is the call graph for this function:

s32 MBNG_FILE_R_Unload ( void   ) 

Unloads script file Called from MBNG_FILE_RheckSDCard() when the SD card has been disconnected

Returns:
< 0 on errors
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_VarSectionSet ( u8  section  ) 

Set/Get functions for variables

Returns:
< 0 on errors
s32 MBNG_FILE_R_VarValueGet (  ) 
s32 MBNG_FILE_R_VarValueSet ( u8  value  ) 
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

Here is the call graph for this function:

s32 parseCondition ( u32  line,
char *  command,
char **  brkt,
u8  tokenize_req 
)

help function which parses an IF condition

Returns:
>= 0 if condition is valid
< 0 if condition is invalid
s32 parseDelay ( u32  line,
char *  command,
char **  brkt,
u8  tokenize_req 
)

help function which parses a DELAY_MS command returns > 0 if a delay has been requested

s32 parseExecMeta ( u32  line,
char *  command,
char **  brkt,
u8  tokenize_req 
)

help function which parses a EXEC_META command

Here is the call graph for this function:

s32 parseLoad ( u32  line,
char *  command,
char **  brkt,
char *  load_filename,
u8  tokenize_req 
)

help function which parses a LOAD command returns > 0 if a valid filename has been specified

s32 parseSend ( u32  line,
char *  command,
char **  brkt,
u8  tokenize_req 
)

help function which parses a SEND command

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:


Variable Documentation

char mbng_file_r_script_name[MBNG_FILE_R_FILENAME_LEN+1]

Global variables


Generated on 22 Jan 2016 for MIDIboxNG by  doxygen 1.6.1