Skip to content

Commit

Permalink
add dedicated target for cross f4
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Mar 19, 2023
1 parent 1818c8f commit 6d704dc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 10 deletions.
6 changes: 6 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ build_flags =
${stm32f411.build_flags}
-Isrc/target/crazybee_f4_elrs

[env:cross_f4]
extends = stm32f411
build_flags =
${stm32f411.build_flags}
-Isrc/target/cross_f4

[env:ff_racepit]
extends = stm32f405
build_flags =
Expand Down
17 changes: 14 additions & 3 deletions script/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,9 @@
"BRUSHLESS_TARGET": ""
}
}
]
},
{
]
},
{
"name": "zeezwhoop",
"configurations": [
{
Expand Down Expand Up @@ -802,5 +802,16 @@
}
}
]
},
{
"name": "cross_f4",
"configurations": [
{
"name": "brushless",
"defines": {
"BRUSHLESS_TARGET": ""
}
}
]
}
]
7 changes: 0 additions & 7 deletions src/target/crazybee_f4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#define LED1_INVERT
#define BUZZER_PIN PIN_C15

// #define FPV_PIN LL_GPIO_PIN_13
// #define FPV_PORT GPIOA

// GYRO
#define GYRO_SPI_PORT SPI_PORT1
#define GYRO_NSS PIN_A4
Expand All @@ -29,10 +26,6 @@
#define MAX7456_SPI_PORT SPI_PORT2
#define MAX7456_NSS PIN_B12

#define USE_M25P16
#define M25P16_SPI_PORT SPI_PORT2
#define M25P16_NSS_PIN PIN_A14

// VOLTAGE DIVIDER
#define VBAT_PIN PIN_B0
#define VBAT_DIVIDER_R1 10000
Expand Down
44 changes: 44 additions & 0 deletions src/target/cross_f4/target.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "config.h"

// PORTS
#define SPI_PORTS \
SPI1_PA5PA6PA7 \
SPI2_PB13PB14PB15 \
SPI3_PB3PB4PB5

#define USART_PORTS \
USART1_PA10PA9 \
USART2_PA3PA2

// LEDS
#define LED_NUMBER 1
#define LED1PIN PIN_C13
#define LED1_INVERT
#define BUZZER_PIN PIN_C15

// GYRO
#define GYRO_SPI_PORT SPI_PORT1
#define GYRO_NSS PIN_A4
#define GYRO_INT PIN_A1

// OSD
#define USE_MAX7456
#define MAX7456_SPI_PORT SPI_PORT2
#define MAX7456_NSS PIN_B12

#define USE_M25P16
#define M25P16_SPI_PORT SPI_PORT2
#define M25P16_NSS_PIN PIN_A14

// VOLTAGE DIVIDER
#define VBAT_PIN PIN_B0
#define VBAT_DIVIDER_R1 10000
#define VBAT_DIVIDER_R2 1000

#define IBAT_PIN PIN_B1

// MOTOR PINS
#define MOTOR_PIN0 MOTOR_PIN_PB7
#define MOTOR_PIN1 MOTOR_PIN_PB8
#define MOTOR_PIN2 MOTOR_PIN_PB10
#define MOTOR_PIN3 MOTOR_PIN_PB6

0 comments on commit 6d704dc

Please sign in to comment.