Your ROOT_URL in app.ini is https://git.ondrovo.com/ but you are visiting http://159.69.29.240:49153/MightyPork/tangara-fw/commit/5a2f0b08e0e3f20cda977b510b680d5843ae7283?style=split&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
7 additions and
5 deletions
src/drivers/include/gpios.hpp
src/system_fsm/booting.cpp
src/system_fsm/system_fsm.cpp
src/ui/ui_fsm.cpp
@ -77,6 +77,8 @@ class IGpios {
* Returns the most recently cached value of the given pin .
* Returns the most recently cached value of the given pin .
*/
*/
virtual auto Get ( Pin ) const - > bool = 0 ;
virtual auto Get ( Pin ) const - > bool = 0 ;
virtual auto IsLocked ( ) const - > bool { return Get ( Pin : : kKeyLock ) ; }
} ;
} ;
class Gpios : public IGpios {
class Gpios : public IGpios {
@ -121,7 +121,7 @@ auto Booting::exit() -> void {
auto Booting : : react ( const BootComplete & ev ) - > void {
auto Booting : : react ( const BootComplete & ev ) - > void {
ESP_LOGI ( kTag , " bootup completely successfully " ) ;
ESP_LOGI ( kTag , " bootup completely successfully " ) ;
if ( sServices - > gpios ( ) . Get ( drivers : : Gpios : : Pin : : kKeyLock ) ) {
if ( sServices - > gpios ( ) . IsLocked ( ) ) {
transit < Idle > ( ) ;
transit < Idle > ( ) ;
} else {
} else {
transit < Running > ( ) ;
transit < Running > ( ) ;
@ -46,12 +46,12 @@ void SystemState::react(const HapticTrigger& trigger) {
void SystemState : : react ( const internal : : GpioInterrupt & ) {
void SystemState : : react ( const internal : : GpioInterrupt & ) {
auto & gpios = sServices - > gpios ( ) ;
auto & gpios = sServices - > gpios ( ) ;
bool prev_key_lock = gpios . Get ( drivers : : Gpios : : Pin : : kKeyLock ) ;
bool prev_key_lock = gpios . IsLocked ( ) ;
bool prev_has_headphones = ! gpios . Get ( drivers : : Gpios : : Pin : : kPhoneDetect ) ;
bool prev_has_headphones = ! gpios . Get ( drivers : : Gpios : : Pin : : kPhoneDetect ) ;
gpios . Read ( ) ;
gpios . Read ( ) ;
bool key_lock = gpios . Get ( drivers : : Gpios : : Pin : : kKeyLock ) ;
bool key_lock = gpios . IsLocked ( ) ;
bool has_headphones = ! gpios . Get ( drivers : : Gpios : : Pin : : kPhoneDetect ) ;
bool has_headphones = ! gpios . Get ( drivers : : Gpios : : Pin : : kPhoneDetect ) ;
if ( key_lock ! = prev_key_lock ) {
if ( key_lock ! = prev_key_lock ) {
@ -87,7 +87,7 @@ void SystemState::react(const internal::SamdInterrupt&) {
}
}
auto SystemState : : IdleCondition ( ) - > bool {
auto SystemState : : IdleCondition ( ) - > bool {
return sServices - > gpios ( ) . Get ( drivers : : IGpios : : Pin : : kKeyLock ) & &
return sServices - > gpios ( ) . IsLocked ( ) & &
audio : : AudioState : : is_in_state < audio : : states : : Standby > ( ) ;
audio : : AudioState : : is_in_state < audio : : states : : Standby > ( ) ;
}
}
@ -80,7 +80,7 @@ auto UiState::InitBootSplash(drivers::IGpios& gpios) -> bool {
sCurrentScreen . reset ( new screens : : Splash ( ) ) ;
sCurrentScreen . reset ( new screens : : Splash ( ) ) ;
sTask . reset ( UiTask : : Start ( ) ) ;
sTask . reset ( UiTask : : Start ( ) ) ;
sDisplay - > SetDisplayOn ( ! gpios . Get ( drivers : : IGpios : : Pin : : kKeyLock ) ) ;
sDisplay - > SetDisplayOn ( ! gpios . IsLocked ( ) ) ;
return true ;
return true ;
}
}