Skip to content

Commit

Permalink
fix compilation with lilygo boards
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Nov 8, 2023
1 parent 3d2f96c commit 9b09592
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ports/espressif/boards/lilygo_ttgo_t_twr_plus/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static XPowersPMU PMU;

#endif /* CONFIG_XPOWERS_CHIP_AXP2102 */

#define I2C_MASTER_NUM 1
#define I2C_MASTER_NUM I2C_NUM_1
#define I2C_MASTER_FREQ_HZ 100000 /*!< I2C master clock frequency */
#define I2C_MASTER_SDA_IO (gpio_num_t) 8
#define I2C_MASTER_SCL_IO (gpio_num_t) 9
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/boards/lilygo_ttgo_tbeam_s3/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static XPowersPMU PMU;
#endif /* CONFIG_XPOWERS_CHIP_AXP2102 */


#define I2C_MASTER_NUM CONFIG_I2C_MASTER_PORT_NUM
#define I2C_MASTER_NUM ((i2c_port_t) CONFIG_I2C_MASTER_PORT_NUM)
#define I2C_MASTER_FREQ_HZ CONFIG_I2C_MASTER_FREQUENCY /*!< I2C master clock frequency */
#define I2C_MASTER_SDA_IO (gpio_num_t)CONFIG_PMU_I2C_SDA
#define I2C_MASTER_SCL_IO (gpio_num_t)CONFIG_PMU_I2C_SCL
Expand Down
14 changes: 6 additions & 8 deletions ports/espressif/components/XPowersLib/src/XPowersAXP2101.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ typedef enum {
XPOWER_POWERON_SRC_BAT_CHARGE, //Vbus Insert and Good as POWERON Source
XPOWER_POWERON_SRC_BAT_INSERT, //Battery Insert and Good as POWERON Source
XPOWER_POWERON_SRC_ENMODE, //POWERON always high when EN Mode as POWERON Source
XPOWER_POWERON_SRC_UNKONW, //Unkonw
XPOWER_POWERON_SRC_UNKONW, //Unknown
} xpower_power_on_source_t;

typedef enum {
Expand All @@ -186,7 +186,7 @@ typedef enum {
XPOWER_POWEROFF_SRC_UNDER_VOL, //DCDC Under Voltage as POWEROFF Source
XPOWER_POWEROFF_SRC_OVER_VOL, //DCDC Over Voltage as POWEROFF Source
XPOWER_POWEROFF_SRC_OVER_TEMP, //Die Over Temperature as POWEROFF Source
XPOWER_POWEROFF_SRC_UNKONW, //Unkonw
XPOWER_POWEROFF_SRC_UNKONW, //Unknown
} xpower_power_off_source_t;

typedef enum {
Expand Down Expand Up @@ -962,7 +962,8 @@ public:
{
int val = readRegister(XPOWERS_AXP2101_SLEEP_WAKEUP_CTRL);
if (val == -1)return;
enable ? (val | opt) : (val & (~opt));
//enable ? (val | opt) : (val & (~opt));
(void) enable;
writeRegister(XPOWERS_AXP2101_SLEEP_WAKEUP_CTRL, val | opt);
}

Expand Down Expand Up @@ -2079,7 +2080,7 @@ public:


/*
* Power ON OFF IRQ TIMMING Control method
* Power ON OFF IRQ TIMING Control method
*/

void setIrqLevelTime(xpowers_irq_time_t opt)
Expand Down Expand Up @@ -2502,7 +2503,7 @@ public:
#endif

/**
* @brief Eanble PMU interrupt control mask .
* @brief Enable PMU interrupt control mask .
* @param opt: View the related chip type xpowers_axp2101_irq_t enumeration
* parameters in "XPowersParams.hpp"
* @retval
Expand Down Expand Up @@ -2991,6 +2992,3 @@ private:
uint8_t statusRegister[XPOWERS_AXP2101_INTSTS_CNT];
uint8_t intRegister[XPOWERS_AXP2101_INTSTS_CNT];
};



0 comments on commit 9b09592

Please sign in to comment.