Initializing the Library: Difference between revisions
DickHamill (talk | contribs) (Created page with "In the .ino file, the setup() function will initialize the RPU library and prepare the MPU for booting. There are several options for the RPU_InitializeMPU function that allow the developer to choose how the machine will boot. ''' unsigned long RPU_InitializeMPU(unsigned long initOptions=RPU_CMD_PERFORM_MPU_TEST, byte creditResetSwitch=0xFF); ''' By default, the RPU_InitializeMPU function will assume that it should boot to the new code running on the Ardu...") |
DickHamill (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
In the .ino file, the setup() function will initialize the RPU library and prepare the MPU for booting. | In the .ino file, the setup() function will initialize the RPU library and prepare the MPU for booting. | ||
There are several options for the RPU_InitializeMPU function that allow the developer to choose how the machine will boot. | |||
There are several options for the RPU_InitializeMPU function that allow the developer to choose how the machine will boot. <blockquote>unsigned long RPU_InitializeMPU(unsigned long initOptions=RPU_CMD_PERFORM_MPU_TEST, byte creditResetSwitch=0xFF); </blockquote>By default, the RPU_InitializeMPU function will assume that it should boot to the new code running on the Arduino. The parameters will describe the situations when the developer wants the board to boot to the original (M6800) code. <blockquote> | |||
RPU_CMD_BOOT_ORIGINAL - This will boot to original unconditionally (disables new code completely for this install) | |||
RPU_CMD_BOOT_ORIGINAL_IF_CREDIT_RESET - Only supported on Rev 4 or greater, boots original if the C/R button is held at power on | |||
RPU_CMD_BOOT_ORIGINAL_IF_NOT_CREDIT_RESET - Only supported on Rev 4 or greater, boots original if the C/R button is NOT held at power on | |||
RPU_CMD_BOOT_ORIGINAL_IF_SWITCH_CLOSED - boots to original if the switch is closed at power on | |||
RPU_CMD_BOOT_ORIGINAL_IF_NOT_SWITCH_CLOSED - boots to original if the switch is NOT closed at power on | |||
</blockquote>There are also parameters to control other boot behavior: <blockquote>RPU_CMD_AUTODETECT_ARCHITECTURE - For Rev 101 and greater--the code detects architecture of board (mainly for diagnostics applications) | |||
RPU_CMD_PERFORM_MPU_TEST - perform basic tests on PIAs and return result codes </blockquote> | |||
These defines are used as Bit flags in the first parameter of the function. | |||
To tell the board to boot to original code if the jumper switch is not set, or the credit/reset button is held at power on, these parameters can be used:<blockquote> | |||
RPU_InitializeMPU(RPU_CMD_BOOT_ORIGINAL_IF_CREDIT_RESET | RPU_CMD_BOOT_ORIGINAL_IF_NOT_SWITCH_CLOSED, SW_CREDIT_RESET);</blockquote> | |||
To tell the board to boot to original code if the jumper switch is not set, or the credit/reset button is held at power on, these parameters can be used: | |||
RPU_InitializeMPU(RPU_CMD_BOOT_ORIGINAL_IF_CREDIT_RESET | RPU_CMD_BOOT_ORIGINAL_IF_NOT_SWITCH_CLOSED, SW_CREDIT_RESET); | |||
Note: the second parameter must tell the library the ID of the Credit/Reset switch if that's being used for a boot condition. | Note: the second parameter must tell the library the ID of the Credit/Reset switch if that's being used for a boot condition. |
Latest revision as of 11:23, 1 July 2023
In the .ino file, the setup() function will initialize the RPU library and prepare the MPU for booting.
There are several options for the RPU_InitializeMPU function that allow the developer to choose how the machine will boot.
unsigned long RPU_InitializeMPU(unsigned long initOptions=RPU_CMD_PERFORM_MPU_TEST, byte creditResetSwitch=0xFF);
By default, the RPU_InitializeMPU function will assume that it should boot to the new code running on the Arduino. The parameters will describe the situations when the developer wants the board to boot to the original (M6800) code.
RPU_CMD_BOOT_ORIGINAL - This will boot to original unconditionally (disables new code completely for this install)
RPU_CMD_BOOT_ORIGINAL_IF_CREDIT_RESET - Only supported on Rev 4 or greater, boots original if the C/R button is held at power on
RPU_CMD_BOOT_ORIGINAL_IF_NOT_CREDIT_RESET - Only supported on Rev 4 or greater, boots original if the C/R button is NOT held at power on
RPU_CMD_BOOT_ORIGINAL_IF_SWITCH_CLOSED - boots to original if the switch is closed at power on
RPU_CMD_BOOT_ORIGINAL_IF_NOT_SWITCH_CLOSED - boots to original if the switch is NOT closed at power on
There are also parameters to control other boot behavior:
RPU_CMD_AUTODETECT_ARCHITECTURE - For Rev 101 and greater--the code detects architecture of board (mainly for diagnostics applications) RPU_CMD_PERFORM_MPU_TEST - perform basic tests on PIAs and return result codes
These defines are used as Bit flags in the first parameter of the function.
To tell the board to boot to original code if the jumper switch is not set, or the credit/reset button is held at power on, these parameters can be used:
RPU_InitializeMPU(RPU_CMD_BOOT_ORIGINAL_IF_CREDIT_RESET | RPU_CMD_BOOT_ORIGINAL_IF_NOT_SWITCH_CLOSED, SW_CREDIT_RESET);
Note: the second parameter must tell the library the ID of the Credit/Reset switch if that's being used for a boot condition.