Skip to content

Commit c69edf6

Browse files
committed
PlatformIO
1 parent 914ae97 commit c69edf6

File tree

4 files changed

+48
-35
lines changed

4 files changed

+48
-35
lines changed
Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
; PlatformIO Project Configuration File
1+
;============================================================
2+
; madflight PlatformIO Project Configuration File
23
;
3-
; Build options: build flags, source filter
4-
; Upload options: custom upload port, speed and extra flags
5-
; Library options: dependencies, extra library storages
6-
; Advanced options: extra scripting
7-
;
8-
; Please visit documentation for the other options and examples
4+
; Please visit documentation for options and examples
95
; https://docs.platformio.org/page/projectconf.html
10-
;
11-
;
12-
; MADFLIGHT NOTES
13-
; ===============
14-
;
15-
; For the latest madflight release version use
16-
; lib_deps = qqqlab/madflight
17-
;
18-
; For the latest madflight development version use
19-
; lib_deps = https://github.com/qqqlab/madflight.git
20-
;
21-
; For a particular madflight branch/tag use
22-
; lib_deps = https://github.com/qqqlab/madflight.git#v2.0.1
23-
;
24-
; RP2040/RP2350 is not merged into mainline PlatformIO, see
25-
; https://arduino-pico.readthedocs.io/en/latest/platformio.html
26-
; on Windows you need to enable long path names, see above link for instructions
6+
;============================================================
7+
8+
[env]
9+
; Include madflight library from PlatformIO Registry
10+
;lib_deps = qqqlab/madflight
11+
12+
; Other options to include the madflight library: (you might need to execute "Clean" or delete the .pio folder when you change lib_deps)
13+
14+
; Latest madflight development version
15+
;lib_deps = https://github.com/qqqlab/madflight.git
16+
17+
; Particular madflight branch/tag
18+
;lib_deps = https://github.com/qqqlab/madflight.git#v2.1.0
19+
20+
; Folder on local drive
21+
;lib_deps = symlink://C:/path/to/lib/madflight
22+
23+
; Copy from folder on local drive
24+
;lib_deps = file://C:/path/to/lib/madflight
25+
26+
; Default monitor speed for madflight
27+
monitor_speed = 115200
2728

2829
[platformio]
29-
default_envs = esp32s3
30+
; Optionally set the default env(s) to compile, instead of "all environments"
31+
;default_envs = esp32s3
3032

31-
[env]
32-
lib_deps = qqqlab/madflight ; Include madflight library
33-
monitor_speed = 115200 ; Default monitor speed for madflight
33+
;============================================================
34+
; ESP32 TARGETS
35+
;============================================================
3436

3537
[env:esp32]
3638
board = esp32dev
@@ -46,6 +48,13 @@ build_flags =
4648
-DARDUINO_USB_MODE=1
4749
-DARDUINO_USB_CDC_ON_BOOT=1
4850

51+
;============================================================
52+
; RP2040/RP2350 TARGETS
53+
;============================================================
54+
; RP2040/RP2350 is not merged into mainline PlatformIO, see
55+
; https://arduino-pico.readthedocs.io/en/latest/platformio.html
56+
; on Windows you need to enable long path names, see above link for instructions
57+
4958
[env:rp2040]
5059
board = pico
5160
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
@@ -64,12 +73,14 @@ platform = https://github.com/maxgerhardt/platform-raspberrypi.git
6473
framework = arduino
6574
board_build.core = earlephilhower
6675

76+
;============================================================
77+
; STM32 TARGETS
78+
;============================================================
79+
6780
[env:stm32f411]
6881
board = blackpill_f411ce
6982
platform = ststm32
7083
framework = arduino
71-
72-
[env:stm32h743]
73-
board = weact_mini_h743vitx
74-
platform = ststm32
75-
framework = arduino
84+
lib_deps =
85+
${env.lib_deps}
86+
stm32duino/STM32duino FreeRTOS

extras/PlatformIO_madflight/src/madflight_hello_world.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ See http://madflight.com for detailed description
99
MIT license
1010
Copyright (c) 2023-2025 https://madflight.com
1111
##########################################################################################################################*/
12+
1213
#include <Arduino.h>
1314

1415
#include "madflight_config.h" //Edit this header file to setup the pins, hardware, radio, etc. for madflight

src/nav/mathlib/math/Functions.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ const T lerp(const T &a, const T &b, const T &s)
258258
}
259259

260260
template<typename T>
261-
constexpr T negate(T value)
261+
T negate(T value)
262262
{
263263
static_assert(sizeof(T) > 2, "implement for T");
264264
return -value;
265265
}
266266

267267
template<>
268-
constexpr int16_t negate<int16_t>(int16_t value)
268+
int16_t negate<int16_t>(int16_t value)
269269
{
270270
if (value == INT16_MAX) {
271271
return INT16_MIN;

src/rcl/RclGizmoMavlink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class RclGizmoMavlink : public RclGizmo {
9090
typedef bool (RclGizmoMavlink::*sched_func_t)();
9191

9292
struct telem_sched_t {
93+
constexpr telem_sched_t(sched_func_t func, uint32_t interval_ms) : func(func), interval_ms(interval_ms), last_ms(0) {}
9394
sched_func_t func;
9495
uint32_t interval_ms;
9596
uint32_t last_ms = 0;

0 commit comments

Comments
 (0)