9XR-PRO soft power issue fixed
This commit is contained in:
@@ -38,57 +38,39 @@
|
|||||||
|
|
||||||
uint32_t pwrCheck()
|
uint32_t pwrCheck()
|
||||||
{
|
{
|
||||||
#ifdef SIMU
|
#if defined(SIMU)
|
||||||
return e_power_on;
|
return e_power_on;
|
||||||
#endif
|
#elif defined(REVA)
|
||||||
|
if (PIOC->PIO_PDSR & PIO_PC25)
|
||||||
#if defined(REVC)
|
return e_power_usb;
|
||||||
if ( PIOC->PIO_PDSR & PIO_PC17 ) // Power on
|
else if (PIOA->PIO_PDSR & PIO_PA8)
|
||||||
{
|
return e_power_trainer;
|
||||||
return e_power_on ;
|
else
|
||||||
}
|
return e_power_on;
|
||||||
|
|
||||||
if ( PIOA->PIO_PDSR & PIO_PA8 ) // Trainer plugged in
|
|
||||||
{
|
|
||||||
return e_power_trainer ;
|
|
||||||
}
|
|
||||||
#elif defined(REVB)
|
#elif defined(REVB)
|
||||||
if ( PIOC->PIO_PDSR & PIO_PC17 ) // Power on
|
if (PIOC->PIO_PDSR & PIO_PC17)
|
||||||
{
|
return e_power_on;
|
||||||
return e_power_on ;
|
else if (usbPlugged())
|
||||||
}
|
return e_power_usb;
|
||||||
|
else if ( PIOA->PIO_PDSR & PIO_PA8 )
|
||||||
if (usbPlugged())
|
return e_power_trainer;
|
||||||
{
|
else
|
||||||
return e_power_usb ; // Detected USB
|
return e_power_off;
|
||||||
}
|
|
||||||
|
|
||||||
if ( PIOA->PIO_PDSR & PIO_PA8 ) // Trainer plugged in
|
|
||||||
{
|
|
||||||
return e_power_trainer ;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if ( PIOC->PIO_PDSR & PIO_PC25 )
|
if (PIOC->PIO_PDSR & PIO_PC17)
|
||||||
{
|
return e_power_on;
|
||||||
return e_power_usb ; // Detected USB
|
else if (PIOA->PIO_PDSR & PIO_PA8)
|
||||||
}
|
return e_power_trainer;
|
||||||
|
else
|
||||||
if ( PIOA->PIO_PDSR & PIO_PA8 ) // Trainer plugged in
|
return e_power_off;
|
||||||
{
|
|
||||||
return e_power_trainer ;
|
|
||||||
}
|
|
||||||
|
|
||||||
return e_power_on;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return e_power_off;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn off soft power
|
// turn off soft power
|
||||||
void pwrOff()
|
void pwrOff()
|
||||||
{
|
{
|
||||||
#if !defined(REVA)
|
#if !defined(REVA)
|
||||||
configure_pins( PIO_PA8, PIN_ENABLE | PIN_OUTPUT | PIN_LOW | PIN_PORTA | PIN_NO_PULLUP ) ;
|
configure_pins(PIO_PA8, PIN_ENABLE | PIN_OUTPUT | PIN_LOW | PIN_PORTA | PIN_NO_PULLUP);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +78,7 @@ void pwrOff()
|
|||||||
void pwrInit()
|
void pwrInit()
|
||||||
{
|
{
|
||||||
// Configure RF_power (PC17)
|
// Configure RF_power (PC17)
|
||||||
configure_pins( PIO_PC17, PIN_ENABLE | PIN_INPUT | PIN_PORTC | PIN_NO_PULLUP | PIN_PULLDOWN ) ;
|
configure_pins(PIO_PC17, PIN_ENABLE | PIN_INPUT | PIN_PORTC | PIN_NO_PULLUP | PIN_PULLDOWN);
|
||||||
configure_pins( PIO_PA8, PIN_ENABLE | PIN_INPUT | PIN_PORTA | PIN_PULLUP ) ; // Enable bit A8 (Soft Power)
|
configure_pins(PIO_PA8, PIN_ENABLE | PIN_INPUT | PIN_PORTA | PIN_PULLUP); // Enable bit A8 (Soft Power)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user