It allows any command sent to the its Command Processor to be intercepted and "preprocessed". Command Extensions can be disabled or enabled with a single bit, BIT_SM_SCRIPT in EEPROM BYTE EEbSystemMode. The FLASH address of the subroutine to call to service Command Extensions is specified using the EEfptrNRFCmdExts pointer WORD. Both of these are found in the same definition file, SystemEEPROM.Def, which names and describes how the Operating System uses the first 80 bytes of reserved EEPROM.
The System Command Extensions allow the command to be selectively inspected, augmented, discarded, replaced or otherwise handled before the Operating System has a opportunity to parse the command and take the predetermined action on that command.
When disabled or when the pointer does not point to valid FLASH address, the Operating System handles all commands in the default manner. When enabled and given a valid PROGRAM address, the Operating System calls that address to give the Extension Processing routine "first crack" at handling the command.Passed: | R31:R30 | WORD * | wPtrMyAddress | The ICALL address used to reach this subroutine |
R29:R28 | BYTE * | bPtrUVars | pointer to *uVars.B[0] | |
R27:R26 | BYTE * | bPtrBuffer | pointer to the text buffer being parsed, formatted as: the buffered byte count in the first byte, then the ASCIIz text string (command buffer) follows it |
|
R23 | CHAR | cBuffer3 | third buffered character, uppercase (but may be 0) | |
R22 | CHAR | cBuffer2 | second buffered character, uppercase (but may be 0) | |
R21 | CHAR | cCmdByte | first buffered character, uppercase; the command byte | |
R20 | BYTE | bStrlen | string length, or buffered byte count | |
R19:R18 | WORD * | wPtrHandler | the WORD address of that command's default handler | |
Returns: | FLAGS | ZERO | flag | TRUE if the command was NOT handled (so process as usual), or FALSE if it was handled (so skip the default processing) |
Filename | Description | Notes |
---|---|---|
ExtBaseline.Asm | CE_Default | Default Command Extensions supplied with MIRTOS Version 3.01 |
; All INCLUDE files should be in the same directory as this .ASM source code (or) ; use the "-I" parameter to set the AVR-AS "Include" directory where they are located: .INCLUDE "CommonDefs.Def" ; TRUE, FALSE, YES, NO, BIT_PV_*, et.al. .INCLUDE "BinDefs.Def" ; The B0 to B11111111 definitions .INCLUDE "Indices.Def" ; All 128 indirectly-accessed system jump indices .IF PROCESSOR == 328 .INCLUDE "IOM328P.Def" ; Register definitions for the ATmega328P .INCLUDE "Addresses328.Def" ; All 128 328P system routines' Jump Table addresses .INCLUDE "SystemSRAM328.Def" ; Names and addresses of 328P system SRAM variables .ENDIF .IF PROCESSOR == 1284 .INCLUDE "IOM1284P.Def" ; Register definitions for the ATmega1284P .INCLUDE "Addresses1284.Def" ; All 128 1284P system routines' Jump Table addresses .INCLUDE "SystemSRAM1284.Def" ; Names and addresses of 1284P system SRAM variables .ENDIF .IF PROCESSOR == 2560 .INCLUDE "IOM2560.Def" ; Register definitions for the ATmega2560 .INCLUDE "Addresses2560.Def" ; All 128 2560 system routines' Jump Table addresses .INCLUDE "SystemSRAM2560.Def" ; Names and addresses of 2560 system SRAM variables .ENDIF .IFNDEF APushAllRegisters .ERROR "Exiting: definition files not pulled in." .ENDIF .INCLUDE "SystemEEPROM.Def" ; Names and addresses of system EEPROM variables .INCLUDE "SystemFLASH.Def" ; Names and addresses of system FLASH constants ; ; Only include this last .DEF file if nRF24L01+ constants are needed: .INCLUDE "nRF24L01.Def" ; Register and variable names for nRF radio use
Also see: | Scripts and their extensions, nRF Radio commands and extensions, WS2812 command extensions. |