Skip to content

Commit

Permalink
Merge branch 'main' into new-bat
Browse files Browse the repository at this point in the history
  • Loading branch information
sctanf authored Feb 9, 2024
2 parents e909f27 + 44c4c25 commit 626498c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
7 changes: 7 additions & 0 deletions platformio-tools.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ build_flags =
${env.build_flags}
-DESP32C3
board = esp32-c3-devkitm-1

[env:BOARD_XIAO_ESP32C3]
platform = espressif32 @ 6.1.0
build_flags =
${env.build_flags}
-DESP32C3
board = seeed_xiao_esp32c3
1 change: 1 addition & 0 deletions src/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define BOARD_WRANGLER 14 // Only used by wrangler app
#define BOARD_MOCOPI 15 // Used by mocopi/moslime
#define BOARD_WEMOSWROOM02 16
#define BOARD_XIAO_ESP32C3 17
#define BOARD_DEV_RESERVED 250 // Reserved, should not be used in any release firmware

#define BAT_EXTERNAL 1
Expand Down
17 changes: 17 additions & 0 deletions src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,21 @@ IMU_DESC_ENTRY(IMU_BMP160, PRIMARY_IMU_ADDRESS_ONE, IMU_ROTATION, PIN_IMU_SCL, P
#define PIN_BATTERY_LEVEL A0
#define LED_PIN 16
#define LED_INVERTED true
#elif BOARD == BOARD_XIAO_ESP32C3
#define PIN_IMU_SDA 6 // D4
#define PIN_IMU_SCL 7 // D5
#define PIN_IMU_INT 5 // D3
#define PIN_IMU_INT_2 10 // D10
#define LED_PIN 4 // D2
#define LED_INVERTED false
#define PIN_BATTERY_LEVEL 2 // D0 / A0
#ifndef BATTERY_SHIELD_RESISTANCE
#define BATTERY_SHIELD_RESISTANCE 0
#endif
#ifndef BATTERY_SHIELD_R1
#define BATTERY_SHIELD_R1 100
#endif
#ifndef BATTERY_SHIELD_R2
#define BATTERY_SHIELD_R2 100
#endif
#endif
6 changes: 3 additions & 3 deletions src/sensors/icm20948sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void ICM20948Sensor::motionLoop()
cntbuf = 0;
cntrounds = 0;
}
*/
*/
}

void ICM20948Sensor::readFIFOToEnd()
Expand All @@ -104,9 +104,8 @@ void ICM20948Sensor::readFIFOToEnd()

void ICM20948Sensor::sendData()
{
if(newFusedRotation && lastDataSent + 7 < millis())
if(newFusedRotation)
{
lastDataSent = millis();
newFusedRotation = false;

#if(USE_6_AXIS)
Expand Down Expand Up @@ -320,6 +319,7 @@ void ICM20948Sensor::startMotionLoop()
{
lastData = millis();
working = true;
hadData = true;
}

void ICM20948Sensor::checkSensorTimeout()
Expand Down
1 change: 0 additions & 1 deletion src/sensors/icm20948sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class ICM20948Sensor : public Sensor
private:
void calculateAccelerationWithoutGravity(Quat *quaternion);
unsigned long lastData = 0;
unsigned long lastDataSent = 0;
int bias_save_counter = 0;
bool hasdata = false;
// Performance test
Expand Down

0 comments on commit 626498c

Please sign in to comment.