Skip to content

Commit 429bd68

Browse files
committed
backToSpiffsMergeFixes
1 parent dd0bbd1 commit 429bd68

13 files changed

Lines changed: 32 additions & 44 deletions

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: CI
22
on:
33
push:
4-
branches: [ "master" ]
4+
branches: [ "**" ]
55
pull_request:
6-
branches: [ "master" ]
6+
branches: [ "**" ]
77

88
# Allows you to run this workflow manually from the Actions tab
99
workflow_dispatch:

main/Kconfig.projbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,3 @@ menu "Sparta Ion Config"
104104
default n
105105

106106
endmenu
107-

main/bat.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@ static uint8_t batMvToPercentage(uint32_t batMv) {
151151
void measureBat() {
152152
batMv = measureBatMv();
153153

154-
<<<<<<< HEAD
155-
history += batMv;
156-
uint32_t avg = history >> 7;
157-
history -= avg;
158-
=======
159154
// This is provided by 'mooiweertje' and is pretty much similar to Simple Exponential Smoothing (https://en.wikipedia.org/wiki/Exponential_smoothing).
160155
// By using an alpha of 1/128, and storing the smoothed value scaled by 128 in history, this can be written very efficiently though,
161156
// and the scaled value allows us to work with integers instead of floating point.
@@ -164,7 +159,6 @@ void measureBat() {
164159
history += batMv;
165160
uint32_t avg = history >> 7;
166161
history -= avg;
167-
>>>>>>> 9e922f8 (Add a bit of comments on the new adc code)
168162

169163
batPercentage = batMvToPercentage(avg);
170164
}

main/charge.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include "storage.h"
33
#include "charge.h"
44

5-
#define CHARGE_FILE "/littlefs/charge.bin"
6-
75
// note that Ah is not real Ah but a relative Ah measurement based on ADC and timer.
86

97
struct chargeStruct {

main/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void my_task(void *pvParameter) {
245245
adc_init();
246246
#endif
247247

248-
init_spiffs();
248+
init_fs();
249249

250250
initUart();
251251

main/storage.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
static const char *TAG = "storage";
77

8-
#define CALIBRATION_FILE "/spiffs/calibration.bin"
9-
10-
void init_spiffs() {
8+
void init_fs() {
119
ESP_LOGI(TAG, "Initializing SPIFFS");
1210

1311
esp_vfs_spiffs_conf_t spiffs_conf = {};

main/storage.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
#include <sys/unistd.h>
44

5-
void init_spiffs();
5+
#define CALIBRATION_FILE "/spiffs/calibration.bin"
6+
7+
#define DISTANCE_FILE "/spiffs/distance.bin"
8+
9+
#define CHARGE_FILE "/spiffs/charge.bin"
10+
11+
void init_fs();
612

713
// Is a calibration file stored?
814
bool calibrationFileExists();

main/trip.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include "storage.h"
22
#include "trip.h"
33

4-
#define DISTANCE_FILE "/spiffs/distance.bin"
5-
64
struct distancesStruct {
75
// Trip-1 in 10m increments
86
uint32_t trip1;

sdkconfig.Tesla

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ CONFIG_ION_UART=1
2020
CONFIG_ION_RXD=20
2121
CONFIG_ION_TXD=21
2222

23-
CONFIG_ION_LIGHT=y
24-
CONFIG_ION_LIGHT_PIN=3
25-
CONFIG_ION_LIGHT_PIN_INVERTED=n
26-
2723
CONFIG_ION_RELAY=y
2824
CONFIG_ION_RELAY_PIN=0
2925
CONFIG_ION_RELAY_PIN_INVERTED=n
3026

27+
CONFIG_ION_LIGHT=y
28+
CONFIG_ION_LIGHT_PIN=3
29+
CONFIG_ION_LIGHT_PIN_INVERTED=n
30+
3131
CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y
3232

3333
# --- ADC measuring ---
@@ -46,10 +46,10 @@ CONFIG_ION_ADC_CHAN=2
4646
# The scale of the divider, times 1000, from APM power module
4747
CONFIG_ION_DIVIDER_SCALE=10829
4848

49-
# Consider 22V (2.5V/cell for 8s LiFePo4) empty
50-
CONFIG_ION_ADC_EMPTY_MV=21000
49+
# Consider 23V (2,875V/cell for 8s LiFePo4) empty
50+
CONFIG_ION_ADC_EMPTY_MV=23000
5151

52-
# Consider 27V (3.5V/cell for 8s LiFePo4) full
52+
# Consider 27V (3,375V/cell for 8s LiFePo4) full
5353
CONFIG_ION_ADC_FULL_MV=27000
5454

5555
# --- Current measuring ---

sdkconfig.TeslaS

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ CONFIG_ION_RELAY_PIN=0
2525
CONFIG_ION_RELAY_PIN_INVERTED=n
2626

2727
CONFIG_ION_LIGHT=y
28-
CONFIG_ION_LIGHT_PIN=1
28+
CONFIG_ION_LIGHT_PIN=3
2929
CONFIG_ION_LIGHT_PIN_INVERTED=n
3030

3131
CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y
@@ -37,6 +37,7 @@ CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y
3737
# ADC channel 2 is pin 2
3838
# ADC channel 3 is pin 3
3939
# ADC channel 4 is pin 4
40+
4041
CONFIG_ION_ADC=y
4142
# --- Voltage measuring ---
4243
# ADC channel 1 is pin 2
@@ -45,10 +46,10 @@ CONFIG_ION_ADC_CHAN=2
4546
# The scale of the divider, times 1000, from APM power module
4647
CONFIG_ION_DIVIDER_SCALE=10829
4748

48-
# Consider 20V (2.5V/cell for 8s) empty
49-
CONFIG_ION_ADC_EMPTY_MV=21000
49+
# Consider 23V (2,875V/cell for 8s LiFePo4) empty
50+
CONFIG_ION_ADC_EMPTY_MV=23000
5051

51-
# Consider 28V (3.5V/cell for 8s) full
52+
# Consider 27V (3,375V/cell for 8s LiFePo4) full
5253
CONFIG_ION_ADC_FULL_MV=27000
5354

5455
# --- Current measuring ---
@@ -61,9 +62,4 @@ CONFIG_ION_CURR_ADC_CHAN=1
6162
CONFIG_ION_BAT_CHARGE=20000
6263

6364
# keepalive
64-
<<<<<<< HEAD:sdkconfig.supermini
65-
CONFIG_ION_KEEPALIVE=y
66-
67-
=======
68-
CONFIG_ION_KEEPALIVE=n
69-
>>>>>>> 8796a39 (Tesla config split):sdkconfig.TeslaS
65+
CONFIG_ION_KEEPALIVE=y

0 commit comments

Comments
 (0)