diff --git a/src/i2c_communication.cpp b/src/i2c_communication.cpp index 31dbb3a..88ea845 100644 --- a/src/i2c_communication.cpp +++ b/src/i2c_communication.cpp @@ -59,11 +59,12 @@ void onReceiveEvent(int bytes) { } // 更新传感器状态和数据 +unsigned long last_gps_data_time = 0; static uint8_t last_receive_cnt = 0; void update_sensor_data() { //gps //if (millis() > 5000 && gps.charsProcessed() < 10 && digitalRead(GPS_POWER_PIN) == HIGH) - if (millis() > 5000 && gps.charsProcessed() < 10) { + if (gps.charsProcessed() < 10) { sensor_data.gps_sta = 0x00; // 无设备 sensor_data.gps_lat = 0.0f; sensor_data.gps_lon = 0.0f;