Preliminary T18 support (#7581)
This commit is contained in:
@@ -51,6 +51,12 @@ void pwrInit()
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||
GPIO_Init(PWR_SWITCH_GPIO, &GPIO_InitStructure);
|
||||
|
||||
#if defined(PWR_EXTRA_SWITCH_GPIO)
|
||||
// PWR Extra switch
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_EXTRA_SWITCH_GPIO_PIN;
|
||||
GPIO_Init(PWR_EXTRA_SWITCH_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(PCBREV_HARDCODED)
|
||||
hardwareOptions.pcbrev = PCBREV_HARDCODED;
|
||||
#elif defined(PCBREV_GPIO_PIN)
|
||||
@@ -101,9 +107,20 @@ void pwrOff()
|
||||
GPIO_ResetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN);
|
||||
}
|
||||
|
||||
#if defined(PWR_EXTRA_SWITCH_GPIO)
|
||||
bool pwrForcePressed()
|
||||
{
|
||||
return (GPIO_ReadInputDataBit(PWR_SWITCH_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET && GPIO_ReadInputDataBit(PWR_EXTRA_SWITCH_GPIO, PWR_EXTRA_SWITCH_GPIO_PIN) == Bit_RESET);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool pwrPressed()
|
||||
{
|
||||
#if defined(PWR_EXTRA_SWITCH_GPIO)
|
||||
return (GPIO_ReadInputDataBit(PWR_SWITCH_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET || GPIO_ReadInputDataBit(PWR_EXTRA_SWITCH_GPIO, PWR_EXTRA_SWITCH_GPIO_PIN) == Bit_RESET);
|
||||
#else
|
||||
return GPIO_ReadInputDataBit(PWR_SWITCH_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
||||
#endif
|
||||
}
|
||||
|
||||
void pwrResetHandler()
|
||||
|
||||
Reference in New Issue
Block a user