hardware driver separation
This commit is contained in:
@@ -35,9 +35,11 @@ static uint8_t brightness = 0;
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void display_setup( TTGOClass *ttgo ) {
|
||||
void display_setup( void ) {
|
||||
display_read_config();
|
||||
|
||||
TTGOClass *ttgo = TTGOClass::getWatch();
|
||||
|
||||
ttgo->openBL();
|
||||
ttgo->bl->adjust( 0 );
|
||||
ttgo->tft->setRotation( display_config.rotation / 90 );
|
||||
@@ -46,7 +48,9 @@ void display_setup( TTGOClass *ttgo ) {
|
||||
/*
|
||||
* loop routine for handling IRQ in main loop
|
||||
*/
|
||||
void display_loop( TTGOClass *ttgo ) {
|
||||
void display_loop( void ) {
|
||||
TTGOClass *ttgo = TTGOClass::getWatch();
|
||||
|
||||
if ( !powermgm_get_event( POWERMGM_STANDBY ) && !powermgm_get_event( POWERMGM_SILENCE_WAKEUP )) {
|
||||
if ( dest_brightness != brightness ) {
|
||||
if ( brightness < dest_brightness ) {
|
||||
|
||||
@@ -46,13 +46,13 @@
|
||||
*
|
||||
* @param ttgo pointer to an TTGOClass
|
||||
*/
|
||||
void display_setup( TTGOClass *ttgo );
|
||||
void display_setup( void );
|
||||
/*
|
||||
* @brief display loop
|
||||
*
|
||||
* @param ttgo pointer to an TTGOClass
|
||||
*/
|
||||
void display_loop( TTGOClass *ttgo );
|
||||
void display_loop( void );
|
||||
/*
|
||||
* @brief save config for display to spiffs
|
||||
*/
|
||||
|
||||
@@ -341,3 +341,13 @@ float pmu_get_coulumb_data( void ) {
|
||||
TTGOClass *ttgo = TTGOClass::getWatch();
|
||||
return( ttgo->power->getCoulombData() );
|
||||
}
|
||||
|
||||
bool pmu_is_charging( void ) {
|
||||
TTGOClass *ttgo = TTGOClass::getWatch();
|
||||
return( ttgo->power->isChargeing() );
|
||||
}
|
||||
|
||||
bool pmu_is_vbus_plug( void ) {
|
||||
TTGOClass *ttgo = TTGOClass::getWatch();
|
||||
return( ttgo->power->isVBUSPlug() );
|
||||
}
|
||||
@@ -104,5 +104,7 @@
|
||||
float pmu_get_battery_discharge_current( void );
|
||||
float pmu_get_vbus_voltage( void );
|
||||
float pmu_get_coulumb_data( void );
|
||||
bool pmu_is_charging( void );
|
||||
bool pmu_is_vbus_plug( void );
|
||||
|
||||
#endif // _PMU_H
|
||||
@@ -170,7 +170,7 @@ void powermgm_loop( void ) {
|
||||
else {
|
||||
pmu_loop();
|
||||
bma_loop();
|
||||
display_loop( ttgo );
|
||||
display_loop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user