options.txt numbers can now be decimal, hex (and probably octal)
reboot clears LCD on the way down
This commit is contained in:
parent
29aa351b9b
commit
5b091e9b8c
4 changed files with 14 additions and 26 deletions
|
@ -23,8 +23,8 @@
|
|||
extern "C"
|
||||
{
|
||||
#include "rpi-aux.h"
|
||||
extern void reboot_now(void);
|
||||
}
|
||||
extern void Reboot_Pi(void);
|
||||
|
||||
// If disk swaps can be done via multiple cores then directDiskSwapRequest needs to be volatile. WARNING: volatile acesses can be very expensive.
|
||||
//volatile unsigned InputMappings::directDiskSwapRequest = 0;
|
||||
|
@ -204,7 +204,7 @@ bool InputMappings::CheckKeyboardBrowseMode()
|
|||
}
|
||||
|
||||
if (keyboard->KeyHeld(KEY_DELETE) && keyboard->KeyLCtrlAlt() )
|
||||
reboot_now();
|
||||
Reboot_Pi();
|
||||
|
||||
if (keyboard->KeyHeld(KEY_ESC))
|
||||
SetKeyboardFlag(ESC_FLAG);
|
||||
|
@ -295,7 +295,7 @@ void InputMappings::CheckKeyboardEmulationMode(unsigned numberOfImages, unsigned
|
|||
return;
|
||||
|
||||
if (keyboard->KeyHeld(KEY_DELETE) && keyboard->KeyLCtrlAlt() )
|
||||
reboot_now();
|
||||
Reboot_Pi();
|
||||
|
||||
if (keyboard->KeyHeld(KEY_ESC))
|
||||
SetKeyboardFlag(ESC_FLAG);
|
||||
|
|
|
@ -47,9 +47,7 @@
|
|||
extern unsigned versionMajor;
|
||||
extern unsigned versionMinor;
|
||||
|
||||
extern "C" {
|
||||
extern void reboot_now(void);
|
||||
}
|
||||
extern void Reboot_Pi();
|
||||
|
||||
#define WaitWhile(checkStatus) \
|
||||
do\
|
||||
|
@ -1232,7 +1230,7 @@ void IEC_Commands::User(void)
|
|||
break;
|
||||
case 202:
|
||||
// Really hard reset - reboot Pi
|
||||
reboot_now();
|
||||
Reboot_Pi();
|
||||
break;
|
||||
case '0':
|
||||
//OPEN1,8,15,"U0>"+CHR$(9):CLOSE1
|
||||
|
|
|
@ -1291,6 +1291,13 @@ static void CheckOptions()
|
|||
}
|
||||
}
|
||||
|
||||
void Reboot_Pi()
|
||||
{
|
||||
if (screenLCD)
|
||||
screenLCD->ClearInit(0);
|
||||
reboot_now();
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void kernel_main(unsigned int r0, unsigned int r1, unsigned int atags)
|
||||
|
|
|
@ -299,26 +299,9 @@ void Options::Process(char* buffer)
|
|||
unsigned Options::GetDecimal(char* pString)
|
||||
{
|
||||
if (pString == 0 || *pString == '\0')
|
||||
return INVALID_VALUE;
|
||||
return 0;
|
||||
|
||||
unsigned nResult = 0;
|
||||
|
||||
char chChar = *pString++;
|
||||
while (chChar != '\0' && chChar != 13)
|
||||
{
|
||||
if (!('0' <= chChar && chChar <= '9'))
|
||||
return INVALID_VALUE;
|
||||
|
||||
unsigned nPrevResult = nResult;
|
||||
|
||||
nResult = nResult * 10 + (chChar - '0');
|
||||
if (nResult < nPrevResult || nResult == INVALID_VALUE)
|
||||
return INVALID_VALUE;
|
||||
|
||||
chChar = *pString++;
|
||||
}
|
||||
|
||||
return nResult;
|
||||
return strtol(pString, NULL, 0);
|
||||
}
|
||||
|
||||
float Options::GetFloat(char* pString)
|
||||
|
|
Loading…
Reference in a new issue