Skip to content

Commit 567e71e

Browse files
committed
BLUEBERRYF405: Adjustments based on initial testing
1 parent f5e822c commit 567e71e

4 files changed

Lines changed: 22 additions & 21 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
target_stm32f405xg(BLUEBERRYF405)
1+
target_stm32f405xg(BLUEBERRYF405)

src/main/target/BLUEBERRYF405/config.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
#include "platform.h"
2020
#include "fc/fc_msp_box.h"
2121
#include "fc/config.h"
22+
#include "drivers/pwm_mapping.h"
2223
#include "io/piniobox.h"
2324

2425
void targetConfiguration(void)
2526
{
2627
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
2728
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
28-
beeperConfigMutable()->pwmMode = true;
29+
30+
// S1 and S2 are not as readily accessible
31+
timerOverridesMutable(timer2id(TIM1))->outputMode = OUTPUT_MODE_MOTORS;
32+
timerOverridesMutable(timer2id(TIM2))->outputMode = OUTPUT_MODE_SERVOS;
2933
}

src/main/target/BLUEBERRYF405/target.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ timerHardware_t timerHardware[] = {
4040
DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S11 D(1,0,2)
4141

4242
DEF_TIM(TIM3, CH4, PB1, TIM_USE_LED, 0, 0), // 2812LED D(1,2,5)
43-
DEF_TIM(TIM11, CH1, PB9, TIM_USE_BEEPER, 0, 0), // BEEPER PWM
44-
45-
// DEF_TIM(TIM9, CH2, PA3, TIM_USE_PPM, 0, 0), //RX2
46-
DEF_TIM(TIM5, CH3, PA2, TIM_USE_ANY, 0, 0), //TX2 softserial1_Tx
43+
44+
DEF_TIM(TIM5, CH3, PA2, TIM_USE_ANY, 0, 0), // softserial1_TX (PA2 shared with UART2_TX)
4745
};
4846

4947
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

src/main/target/BLUEBERRYF405/target.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,22 @@
1818
#pragma once
1919
#define USE_TARGET_CONFIG
2020

21-
# define TARGET_BOARD_IDENTIFIER "BlueBerry"
22-
# define USBD_PRODUCT_STRING "BLUEBERRYF405"
21+
#define TARGET_BOARD_IDENTIFIER "BLF4"
22+
#define USBD_PRODUCT_STRING "BLUEBERRYF405"
2323

2424
#define LED0 PA14 //Blue
2525
#define LED1 PA13 //Green
2626

2727
#define BEEPER PB9
2828
#define BEEPER_INVERTED
29-
#define BEEPER_PWM_FREQUENCY 2500
3029

3130
// *************** SPI1 IMU & OSD *******************
3231
#define USE_SPI
3332
#define USE_SPI_DEVICE_1
3433

3534
#define SPI1_SCK_PIN PA5
36-
#define SPI1_MISO_PIN PB4
37-
#define SPI1_MOSI_PIN PA7
35+
#define SPI1_MISO_PIN PB4
36+
#define SPI1_MOSI_PIN PA7
3837

3938
#define USE_IMU_ICM42605
4039
#define IMU_ICM42605_ALIGN CW270_DEG_FLIP
@@ -46,23 +45,21 @@
4645
#define BMI270_SPI_BUS BUS_SPI1
4746
#define BMI270_CS_PIN PC14
4847

49-
50-
5148
#define USE_MAX7456
5249
#define MAX7456_SPI_BUS BUS_SPI1
5350
#define MAX7456_CS_PIN PB12
5451

5552
// *************** SPI2 Flash/SD Card ****************
5653
#define USE_SPI_DEVICE_2
5754
#define SPI2_SCK_PIN PB13
58-
#define SPI2_MISO_PIN PC2
59-
#define SPI2_MOSI_PIN PC3
55+
#define SPI2_MISO_PIN PC2
56+
#define SPI2_MOSI_PIN PC3
6057

61-
# define USE_SDCARD
62-
# define USE_SDCARD_SPI
63-
# define SDCARD_SPI_BUS BUS_SPI2
64-
# define SDCARD_CS_PIN PC1
65-
# define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
58+
#define USE_SDCARD
59+
#define USE_SDCARD_SPI
60+
#define SDCARD_SPI_BUS BUS_SPI2
61+
#define SDCARD_CS_PIN PC1
62+
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
6663

6764
// *************** I2C /Baro/Mag *********************
6865
#define USE_I2C
@@ -141,13 +138,15 @@
141138
#define USE_PINIOBOX
142139
#define PINIO1_PIN PA4
143140
#define PINIO2_PIN PB5
141+
// TODO: Check if PINIO1 hardware is active-low; if so, add:
142+
// #define PINIO1_FLAGS PINIO_FLAGS_INVERTED
144143

145144
// *************** LEDSTRIP ************************
146145
#define USE_LED_STRIP
147146
#define WS2811_PIN PB1
148147

149148
// *************** others ************************
150-
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
149+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_SOFTSERIAL)
151150
#define VBAT_SCALE_DEFAULT 2100
152151
#define CURRENT_METER_SCALE 150
153152

0 commit comments

Comments
 (0)