Skip to content

Commit 174e9d4

Browse files
Switch flight count to use uint16
1 parent 66b2d7b commit 174e9d4

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/fc/settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3790,7 +3790,7 @@ groups:
37903790
- name: stats_flight_count
37913791
description: "Total number of flights. The value is updated on every disarm when \"stats\" are enabled."
37923792
default_value: 0
3793-
max: INT32_MAX
3793+
max: UINT16_MAX
37943794

37953795
- name: PG_TIME_CONFIG
37963796
type: timeConfig_t

src/main/fc/stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PG_RESET_TEMPLATE(statsConfig_t, statsConfig,
3232

3333
static uint32_t arm_millis;
3434
static uint32_t arm_distance_cm;
35-
static uint32_t prev_flight_count;
35+
static uint16_t prev_flight_count;
3636

3737
#ifdef USE_ADC
3838
static uint32_t arm_mWhDrawn;

src/main/fc/stats.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
typedef struct statsConfig_s {
66
uint32_t stats_total_time; // [Seconds]
77
uint32_t stats_total_dist; // [Metres]
8-
uint32_t stats_flight_count;
8+
uint16_t stats_flight_count;
99
#ifdef USE_ADC
1010
uint32_t stats_total_energy; // deciWatt hour (x0.1Wh)
1111
#endif
@@ -19,7 +19,7 @@ void statsOnDisarm(void);
1919

2020
#else
2121

22-
#define statsInit() do {} while (0)
22+
#define statsInit() do {} while (0)
2323
#define statsOnArm() do {} while (0)
2424
#define statsOnDisarm() do {} while (0)
2525

0 commit comments

Comments
 (0)