mirror of
https://github.com/Ralim/IronOS.git
synced 2025-07-23 12:23:06 +02:00
* Update header to declare full buffer size * Strip refactoring * Refactor the OLED scrolldown part 1 * High res capable scroll down * Allow button press to skip scroll * Bunch of Misc Fixups
36 lines
744 B
C++
36 lines
744 B
C++
#include "BSP.h"
|
|
#include "BSP_Power.h"
|
|
#include "Pins.h"
|
|
#include "QC3.h"
|
|
#include "Settings.h"
|
|
#include "USBPD.h"
|
|
#include "configuration.h"
|
|
#include "stm32f1xx_hal.h"
|
|
void power_check() {
|
|
#ifdef POW_PD
|
|
// Cant start QC until either PD works or fails
|
|
if (!USBPowerDelivery::negotiationComplete()) {
|
|
return;
|
|
}
|
|
if (USBPowerDelivery::negotiationHasWorked()) {
|
|
return; // We are using PD
|
|
}
|
|
#endif
|
|
#ifdef POW_QC
|
|
QC_resync();
|
|
#endif
|
|
}
|
|
|
|
bool getIsPoweredByDCIN() {
|
|
#if defined(MODEL_TS80) + defined(MODEL_TS80P) > 0
|
|
return false;
|
|
#endif
|
|
#ifdef MODEL_TS101
|
|
// TODO have to check what we are using
|
|
return HAL_GPIO_ReadPin(DC_SELECT_GPIO_Port, DC_SELECT_Pin) == GPIO_PIN_SET;
|
|
#endif
|
|
#ifdef MODEL_TS100
|
|
return true;
|
|
#endif
|
|
}
|