Skip to content

Commit f581508

Browse files
committed
new directory tree
1 parent 8c6fa40 commit f581508

File tree

1,691 files changed

+103308
-95638
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,691 files changed

+103308
-95638
lines changed

examples/00.HelloWorld/madflight_config.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
MADFLIGHT CONFIG
33
==========================================================================================================================
44
5-
The configuration is loaded from two strings: first from madflight_board in <madflight_board.h>, and then from
5+
The configuration is loaded from two strings: first from madflight_board in from the board header in /brd/, and then from
66
madflight_config in this file. If the same setting occurs more than once, the last one is applied.
77
88
The strings are multi-line raw strings in with a key-value list. Anything after '#' or '/' is ignored as comment.
99
1010
You have 3 options to setup the flight controller:
1111
12-
1) Default - Keep "#include <madflight_board.h>", this defines the default pinout as shown on https://madflight.com
12+
1) Default - Keep #define MF_BOARD "brd/default.h", this defines the default pinout as shown on https://madflight.com
1313
for the supported processor families. Now edit madflight_config below, and uncomment and configure imu_gizmo,
1414
imu_bus_type, rcl_gizmo, and other lines as needed. (Do not change the pin_xxx_yyy and xxx_yyy_bus settings.)
1515
16-
2) BetaFlight - Change "#include <madflight_board.h>" to the BetaFlight flight controller you want to use, for example:
17-
"#include <madflight_zzz_MTKS-MATEKH743.h>". See library/madflight/src for all available boards. Edit madflight_config
18-
to fine-tune the configuration.
16+
2) BetaFlight - Change "brd/default.h" to the BetaFlight flight controller you want to use, for example:
17+
#define MF_BOARD "brd/betaflight/MTKS-MATEKH743.h". See library/madflight/src for all available boards. Edit
18+
madflight_config to fine-tune the configuration.
1919
20-
3) Bare Metal - Remove "#include <madflight_board.h>", and set the full configuration in madflight_config below.
20+
3) Bare Metal - Comment out "#define MF_BOARD", and set the full configuration in madflight_config below.
2121
2222
Pins and spi/i2c/serial busses use zero-based numbering, i.e. "gps_ser_bus 0" connects the GPS to the first serial bus
2323
with pins pin_ser0_tx and pin_ser0_rx. Pins use GPIO numbers, not physical pin numbers. Use -1 to disable a pin or bus.
@@ -29,7 +29,8 @@ If things do not work as expected, have a good look at the startup messages!
2929
3030
========================================================================================================================*/
3131

32-
#include <madflight_board.h>
32+
//define the board header to use, or comment out for none
33+
#define MF_BOARD "brd/default.h"
3334

3435
const char madflight_config[] = R""(
3536

examples/01.Quadcopter/01.Quadcopter.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ Copyright (c) 2023-2025 https://madflight.com
4545
#include "madflight_config.h" //Edit this header file to setup the pins, hardware, radio, etc. for madflight
4646
#include <madflight.h>
4747

48+
//prototypes (for PlatformIO, not needed for Arduino IDE)
49+
void led_Blink();
50+
float degreeModulus(float v);
51+
void control_Angle(bool zero_integrators);
52+
void control_Rate(bool zero_integrators);
53+
void out_Mixer();
54+
4855
//========================================================================================================================//
4956
// USER-SPECIFIED VARIABLES //
5057
//========================================================================================================================//

examples/01.Quadcopter/madflight_config.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
MADFLIGHT CONFIG
33
==========================================================================================================================
44
5-
The configuration is loaded from two strings: first from madflight_board in <madflight_board.h>, and then from
5+
The configuration is loaded from two strings: first from madflight_board in from the board header in /brd/, and then from
66
madflight_config in this file. If the same setting occurs more than once, the last one is applied.
77
88
The strings are multi-line raw strings in with a key-value list. Anything after '#' or '/' is ignored as comment.
99
1010
You have 3 options to setup the flight controller:
1111
12-
1) Default - Keep "#include <madflight_board.h>", this defines the default pinout as shown on https://madflight.com
12+
1) Default - Keep #define MF_BOARD "brd/default.h", this defines the default pinout as shown on https://madflight.com
1313
for the supported processor families. Now edit madflight_config below, and uncomment and configure imu_gizmo,
1414
imu_bus_type, rcl_gizmo, and other lines as needed. (Do not change the pin_xxx_yyy and xxx_yyy_bus settings.)
1515
16-
2) BetaFlight - Change "#include <madflight_board.h>" to the BetaFlight flight controller you want to use, for example:
17-
"#include <madflight_zzz_MTKS-MATEKH743.h>". See library/madflight/src for all available boards. Edit madflight_config
18-
to fine-tune the configuration.
16+
2) BetaFlight - Change "brd/default.h" to the BetaFlight flight controller you want to use, for example:
17+
#define MF_BOARD "brd/betaflight/MTKS-MATEKH743.h". See library/madflight/src for all available boards. Edit
18+
madflight_config to fine-tune the configuration.
1919
20-
3) Bare Metal - Remove "#include <madflight_board.h>", and set the full configuration in madflight_config below.
20+
3) Bare Metal - Comment out "#define MF_BOARD", and set the full configuration in madflight_config below.
2121
2222
Pins and spi/i2c/serial busses use zero-based numbering, i.e. "gps_ser_bus 0" connects the GPS to the first serial bus
2323
with pins pin_ser0_tx and pin_ser0_rx. Pins use GPIO numbers, not physical pin numbers. Use -1 to disable a pin or bus.
@@ -29,7 +29,8 @@ If things do not work as expected, have a good look at the startup messages!
2929
3030
========================================================================================================================*/
3131

32-
#include <madflight_board.h>
32+
//define the board header to use, or comment out for none
33+
#define MF_BOARD "brd/default.h"
3334

3435
const char madflight_config[] = R""(
3536

examples/02.QuadcopterAdvanced/02.QuadcopterAdvanced.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ flightmode_enum rcin_to_flightmode_map[6] {RATE, RATE, RATE, RATE, ANGLE, ANGLE}
5454
#include "madflight_config.h" //Edit this header file to setup the pins, hardware, radio, etc. for madflight
5555
#include <madflight.h>
5656

57+
//prototypes (for PlatformIO, not needed for Arduino IDE)
58+
void led_Blink();
59+
float degreeModulus(float v);
60+
void control_Angle(bool zero_integrators);
61+
void control_Rate(bool zero_integrators);
62+
void out_KillSwitchAndFailsafe();
63+
void out_Mixer();
64+
5765
//========================================================================================================================//
5866
// USER-SPECIFIED VARIABLES //
5967
//========================================================================================================================//

examples/02.QuadcopterAdvanced/madflight_config.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
MADFLIGHT CONFIG
33
==========================================================================================================================
44
5-
The configuration is loaded from two strings: first from madflight_board in <madflight_board.h>, and then from
5+
The configuration is loaded from two strings: first from madflight_board in from the board header in /brd/, and then from
66
madflight_config in this file. If the same setting occurs more than once, the last one is applied.
77
88
The strings are multi-line raw strings in with a key-value list. Anything after '#' or '/' is ignored as comment.
99
1010
You have 3 options to setup the flight controller:
1111
12-
1) Default - Keep "#include <madflight_board.h>", this defines the default pinout as shown on https://madflight.com
12+
1) Default - Keep #define MF_BOARD "brd/default.h", this defines the default pinout as shown on https://madflight.com
1313
for the supported processor families. Now edit madflight_config below, and uncomment and configure imu_gizmo,
1414
imu_bus_type, rcl_gizmo, and other lines as needed. (Do not change the pin_xxx_yyy and xxx_yyy_bus settings.)
1515
16-
2) BetaFlight - Change "#include <madflight_board.h>" to the BetaFlight flight controller you want to use, for example:
17-
"#include <madflight_zzz_MTKS-MATEKH743.h>". See library/madflight/src for all available boards. Edit madflight_config
18-
to fine-tune the configuration.
16+
2) BetaFlight - Change "brd/default.h" to the BetaFlight flight controller you want to use, for example:
17+
#define MF_BOARD "brd/betaflight/MTKS-MATEKH743.h". See library/madflight/src for all available boards. Edit
18+
madflight_config to fine-tune the configuration.
1919
20-
3) Bare Metal - Remove "#include <madflight_board.h>", and set the full configuration in madflight_config below.
20+
3) Bare Metal - Comment out "#define MF_BOARD", and set the full configuration in madflight_config below.
2121
2222
Pins and spi/i2c/serial busses use zero-based numbering, i.e. "gps_ser_bus 0" connects the GPS to the first serial bus
2323
with pins pin_ser0_tx and pin_ser0_rx. Pins use GPIO numbers, not physical pin numbers. Use -1 to disable a pin or bus.
@@ -29,7 +29,8 @@ If things do not work as expected, have a good look at the startup messages!
2929
3030
========================================================================================================================*/
3131

32-
#include <madflight_board.h>
32+
//define the board header to use, or comment out for none
33+
#define MF_BOARD "brd/default.h"
3334

3435
const char madflight_config[] = R""(
3536

examples/03.Plane/03.Plane.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ flightmode_enum rcin_to_flightmode_map[6] {MANUAL, MANUAL, ROLL, ROLL, FBWA, FBW
8383
#include "madflight_config.h" //Edit this header file to setup the pins, hardware, radio, etc. for madflight
8484
#include <madflight.h>
8585

86+
//prototypes (for PlatformIO, not needed for Arduino IDE)
87+
void led_Blink();
88+
void control_FBWA(bool zero_integrators);
89+
void control_ROLL(bool zero_integrators);
90+
void control_MANUAL();
91+
void out_Mixer()
92+
8693
//========================================================================================================================//
8794
// OUTPUTS //
8895
//========================================================================================================================//

examples/03.Plane/madflight_config.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
MADFLIGHT CONFIG
33
==========================================================================================================================
44
5-
The configuration is loaded from two strings: first from madflight_board in <madflight_board.h>, and then from
5+
The configuration is loaded from two strings: first from madflight_board in from the board header in /brd/, and then from
66
madflight_config in this file. If the same setting occurs more than once, the last one is applied.
77
88
The strings are multi-line raw strings in with a key-value list. Anything after '#' or '/' is ignored as comment.
99
1010
You have 3 options to setup the flight controller:
1111
12-
1) Default - Keep "#include <madflight_board.h>", this defines the default pinout as shown on https://madflight.com
12+
1) Default - Keep #define MF_BOARD "brd/default.h", this defines the default pinout as shown on https://madflight.com
1313
for the supported processor families. Now edit madflight_config below, and uncomment and configure imu_gizmo,
1414
imu_bus_type, rcl_gizmo, and other lines as needed. (Do not change the pin_xxx_yyy and xxx_yyy_bus settings.)
1515
16-
2) BetaFlight - Change "#include <madflight_board.h>" to the BetaFlight flight controller you want to use, for example:
17-
"#include <madflight_zzz_MTKS-MATEKH743.h>". See library/madflight/src for all available boards. Edit madflight_config
18-
to fine-tune the configuration.
16+
2) BetaFlight - Change "brd/default.h" to the BetaFlight flight controller you want to use, for example:
17+
#define MF_BOARD "brd/betaflight/MTKS-MATEKH743.h". See library/madflight/src for all available boards. Edit
18+
madflight_config to fine-tune the configuration.
1919
20-
3) Bare Metal - Remove "#include <madflight_board.h>", and set the full configuration in madflight_config below.
20+
3) Bare Metal - Comment out "#define MF_BOARD", and set the full configuration in madflight_config below.
2121
2222
Pins and spi/i2c/serial busses use zero-based numbering, i.e. "gps_ser_bus 0" connects the GPS to the first serial bus
2323
with pins pin_ser0_tx and pin_ser0_rx. Pins use GPIO numbers, not physical pin numbers. Use -1 to disable a pin or bus.
@@ -29,7 +29,8 @@ If things do not work as expected, have a good look at the startup messages!
2929
3030
========================================================================================================================*/
3131

32-
#include <madflight_board.h>
32+
//define the board header to use, or comment out for none
33+
#define MF_BOARD "brd/default.h"
3334

3435
const char madflight_config[] = R""(
3536

extras/betaflight_target_converter/betaflight_target_converter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#DEBUG = True
77

88
source_dirname = "betaflight_source" # copy from https://github.com/betaflight/unified-targets/tree/master/configs/default
9-
destination_path = "../../src/"
10-
destination_prefix = "madflight_zzz_"
9+
destination_path = "../../src/brd/betaflight/"
10+
destination_prefix = ""
1111

1212
CMT = " // "
1313

@@ -144,7 +144,7 @@ def fprint(txt) :
144144
fprint( "Manufacturer ID: " + manufacturer_id )
145145
fprint( "" )
146146
fprint( "//copy this line to madflight.ino to use this flight controller" )
147-
fprint( "#include <" + outfilename + ">" )
147+
fprint( "#define MF_BOARD \"brd/betaflight/" + outfilename + "\"" )
148148
fprint( "" )
149149
fprint( "Note: madflight will pick the last sensor defined here, this might not be the sensor that is actually on the board. Comment the offending sensors out, or use madflight_config to override." )
150150
fprint( "==============================================================================*/" )

extras/betaflight_target_converter/readme.md

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)