Merge pull request #735 from cyberman54/development

v2.3.0
This commit is contained in:
Verkehrsrot authored and GitHub committed 2021-01-31 20:51:16 +01:00
commit f2d4c4fcde
6 files changed
+24 -10

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ time_t get_gpstime(uint16_t *msec) {
tm.Year = CalendarYrToTm(atoi(gpsyear.value())); // year offset from 1970
t = makeTime(tm);
ESP_LOGD(TAG, "GPS time/date = %2d:%2d:%2d / %2d.%2d.%2d", tm.Hour,
ESP_LOGD(TAG, "GPS time/date = %02d:%02d:%02d / %02d.%02d.%2d", tm.Hour,
tm.Minute, tm.Second, tm.Day, tm.Month, tm.Year + 1970);
// add protocol delay with millisecond precision
+2 -2
View File
@@ -84,7 +84,7 @@ void i2c_scan(void) {
}
// mutexed functions for i2c r/w access
uint8_t i2c_readBytes(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len) {
int i2c_readBytes(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len) {
if (I2C_MUTEX_LOCK()) {
uint8_t ret = 0;
@@ -112,7 +112,7 @@ uint8_t i2c_readBytes(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len) {
}
}
uint8_t i2c_writeBytes(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len) {
int i2c_writeBytes(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len) {
if (I2C_MUTEX_LOCK()) {
uint8_t ret = 0;
+14 -1
View File
@@ -46,6 +46,14 @@ void AXP192_powerevent_IRQ(void) {
ESP_LOGI(TAG, "Battery high temperature.");
if (pmu.isBattTempHighIRQ())
ESP_LOGI(TAG, "Battery low temperature.");
if (pmu.isLowVoltageLevel1IRQ()) {
ESP_LOGI(TAG, "Battery has reached voltage level 1.");
pmu.setChgLEDMode(AXP20X_LED_BLINK_4HZ);
}
if (pmu.isLowVoltageLevel2IRQ()) {
ESP_LOGI(TAG, "Battery has reached voltage level 2.");
pmu.setChgLEDMode(AXP20X_LED_BLINK_1HZ);
}
// short press -> esp32 deep sleep mode, can be exited by pressing user button
if (pmu.isPEKShortPressIRQ()) {
@@ -129,10 +137,15 @@ void AXP192_init(void) {
pmu.setLDO2Voltage(3300); // LORA VDD 3v3
pmu.setLDO3Voltage(3300); // GPS VDD 3v3
// configure voltage warning levels
pmu.setVWarningLevel1(3600);
pmu.setVWarningLevel2(3800);
pmu.setPowerDownVoltage(3300);
// configure PEK button settings
pmu.setTimeOutShutdown(false); // forced shutdown by PEK enabled
pmu.setShutdownTime(
AXP_POWER_OFF_TIME_65); // 6 sec button press for shutdown
AXP_POWER_OFF_TIME_6S); // 6 sec button press for shutdown
pmu.setlongPressTime(
AXP_LONGPRESS_TIME_1S5); // 1.5 sec button press for long press
pmu.setStartupTime(
+1 -1
View File
@@ -166,7 +166,7 @@ void set_payloadmask(uint8_t val[]) {
void set_sensor(uint8_t val[]) {
#if (HAS_SENSORS)
switch (val[0]) { // check if valid sensor number 1...4
switch (val[0]) { // check if valid sensor number 1..3
case 1:
case 2:
case 3: