Skip to content

Commit 0453aca

Browse files
committed
revert timeout to 0.5s, start l431
1 parent 6448722 commit 0453aca

24 files changed

+3211
-8
lines changed

Inc/targets.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22

33
#ifndef USE_MAKE
4-
//#define FD6288_F051
5-
#define IFLIGHT_F051
4+
#define FD6288_F051
5+
//#define IFLIGHT_F051
66
//#define MP6531_F051
7+
//#define DAKEFPV_35A_F051
8+
79
//#define TMOTOR55_F051 // like iflight but with leds
810
//#define TMOTOR45_F051
911
//#define HGLRC_F051
@@ -59,6 +61,14 @@
5961
#define USE_SERIAL_TELEMETRY
6062
#endif
6163

64+
#ifdef DAKEFPV_35A_F051
65+
#define FILE_NAME "DAKEFPV_35A_F051"
66+
#define FIRMWARE_NAME "DakeFPV 35A"
67+
#define DEAD_TIME 18
68+
#define HARDWARE_GROUP_F0_B
69+
#define USE_SERIAL_TELEMETRY
70+
#endif
71+
6272
#ifdef RAZOR32_F051
6373
#define FILE_NAME "RAZOR32_F051"
6474
#define FIRMWARE_NAME "Razor32 "

Mcu/f031/Src/IO.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ void checkDshot(){
195195
output_timer_prescaler=0;
196196
dshot = 1;
197197
buffer_divider = 44;
198-
buffer_padding = 9;
198+
// buffer_padding = 9;
199199
buffersize = 32;
200200
inputSet = 1;
201201
}
@@ -205,7 +205,7 @@ void checkDshot(){
205205
output_timer_prescaler=1;
206206
IC_TIMER_REGISTER->CNT = 0xffff;
207207
buffer_divider = 44;
208-
buffer_padding = 7;
208+
// buffer_padding = 7;
209209
buffersize = 32;
210210
inputSet = 1;
211211
}

Mcu/l431/Inc/ADC.h

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* ADC.h
3+
*
4+
* Created on: May 20, 2020
5+
* Author: Alka
6+
*/
7+
8+
#include "main.h"
9+
#include "targets.h"
10+
11+
12+
#ifndef ADC_H_
13+
#define ADC_H_
14+
15+
16+
17+
void ADC_DMA_Callback();
18+
void enableADC_DMA();
19+
void activateADC();
20+
void ADC_Init(void);
21+
22+
void Configure_DMA();
23+
24+
void Configure_ADC();
25+
26+
void Activate_ADC();
27+
28+
29+
#endif /* ADC_H_ */

Mcu/l431/Inc/IO.h

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* IO.h
3+
*
4+
* Created on: Sep. 26, 2020
5+
* Author: Alka
6+
*/
7+
8+
#ifndef IO_H_
9+
#define IO_H_
10+
11+
#endif /* IO_H_ */
12+
13+
14+
#include "main.h"
15+
16+
void changeToOutput();
17+
void changeToInput();
18+
void receiveDshotDma();
19+
void sendDshotDma();
20+
void detectInput();
21+
22+
extern char inputSet;
23+
extern char dshot;
24+
extern char servoPwm;
25+
extern char send_telemetry;
26+
extern uint8_t degrees_celsius;
27+
28+
extern uint16_t ADC_raw_volts;

Mcu/l431/Inc/WS2812.h

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* WS2812.h
3+
*
4+
* Created on: Sep 9, 2020
5+
* Author: Alka
6+
*/
7+
8+
#ifndef INC_WS2812_H_
9+
#define INC_WS2812_H_
10+
11+
#include "main.h"
12+
13+
14+
15+
16+
void send_LED_DMA();
17+
void WS2812_Init(void);
18+
void send_LED_RGB(uint8_t red, uint8_t green, uint8_t blue);
19+
20+
extern char dma_busy;
21+
22+
23+
#endif /* INC_WS2812_H_ */

Mcu/l431/Inc/comparator.h

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* comparator.h
3+
*
4+
* Created on: Sep. 26, 2020
5+
* Author: Alka
6+
*/
7+
8+
#ifndef COMPARATOR_H_
9+
#define COMPARATOR_H_
10+
11+
12+
13+
#endif /* COMPARATOR_H_ */
14+
15+
#include "main.h"
16+
17+
void maskPhaseInterrupts();
18+
void changeCompInput();
19+
void enableCompInterrupts();
20+
21+
extern char rising;
22+
extern char step;

Mcu/l431/Inc/eeprom.h

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* bootloader.h
3+
*
4+
* Created on: Mar. 25, 2020
5+
* Author: Alka
6+
*/
7+
#include "main.h"
8+
#ifndef INC_EEPROM_H_
9+
#define INC_EEPROM_H_
10+
11+
12+
13+
#endif /* INC_BOOTLOADER_H_ */
14+
15+
16+
//void save_to_flash(uint8_t *data);
17+
//void read_flash(uint8_t* data, uint32_t address);
18+
//void save_to_flash_bin(uint8_t *data, int length, uint32_t add);
19+
void read_flash_bin(uint8_t* data , uint32_t add ,int out_buff_len);
20+
void save_flash_nolib(uint8_t *data, int length, uint32_t add);

Mcu/l431/Inc/main.h

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* USER CODE BEGIN Header */
2+
/**
3+
******************************************************************************
4+
* @file : main.h
5+
* @brief : Header for main.c file.
6+
* This file contains the common defines of the application.
7+
******************************************************************************
8+
* @attention
9+
*
10+
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
11+
* All rights reserved.</center></h2>
12+
*
13+
* This software component is licensed by ST under BSD 3-Clause license,
14+
* the "License"; You may not use this file except in compliance with the
15+
* License. You may obtain a copy of the License at:
16+
* opensource.org/licenses/BSD-3-Clause
17+
*
18+
******************************************************************************
19+
*/
20+
/* USER CODE END Header */
21+
22+
/* Define to prevent recursive inclusion -------------------------------------*/
23+
#ifndef __MAIN_H
24+
#define __MAIN_H
25+
26+
#ifdef __cplusplus
27+
extern "C" {
28+
#endif
29+
30+
/* Includes ------------------------------------------------------------------*/
31+
#include "stm32g0xx_ll_adc.h"
32+
#include "stm32g0xx_ll_comp.h"
33+
#include "stm32g0xx_ll_exti.h"
34+
#include "stm32g0xx_ll_dma.h"
35+
#include "stm32g0xx_ll_iwdg.h"
36+
#include "stm32g0xx_ll_rcc.h"
37+
#include "stm32g0xx_ll_bus.h"
38+
#include "stm32g0xx_ll_system.h"
39+
#include "stm32g0xx_ll_cortex.h"
40+
#include "stm32g0xx_ll_utils.h"
41+
#include "stm32g0xx_ll_pwr.h"
42+
#include "stm32g0xx_ll_tim.h"
43+
#include "stm32g0xx_ll_gpio.h"
44+
#include "stm32g0xx_ll_usart.h"
45+
46+
#if defined(USE_FULL_ASSERT)
47+
#include "stm32_assert.h"
48+
#endif /* USE_FULL_ASSERT */
49+
50+
/* Private includes ----------------------------------------------------------*/
51+
/* USER CODE BEGIN Includes */
52+
53+
/* USER CODE END Includes */
54+
55+
/* Exported types ------------------------------------------------------------*/
56+
/* USER CODE BEGIN ET */
57+
58+
/* USER CODE END ET */
59+
60+
/* Exported constants --------------------------------------------------------*/
61+
/* USER CODE BEGIN EC */
62+
63+
/* USER CODE END EC */
64+
65+
/* Exported macro ------------------------------------------------------------*/
66+
/* USER CODE BEGIN EM */
67+
68+
/* USER CODE END EM */
69+
70+
/* Exported functions prototypes ---------------------------------------------*/
71+
void Error_Handler(void);
72+
73+
/* USER CODE BEGIN EFP */
74+
75+
/* USER CODE END EFP */
76+
77+
/* Private defines -----------------------------------------------------------*/
78+
/* USER CODE BEGIN Private defines */
79+
80+
/* USER CODE END Private defines */
81+
82+
#ifdef __cplusplus
83+
}
84+
#endif
85+
86+
#endif /* __MAIN_H */
87+
88+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

Mcu/l431/Inc/peripherals.h

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* peripherals.h
3+
*
4+
* Created on: Sep. 26, 2020
5+
* Author: Alka
6+
*/
7+
8+
#ifndef PERIPHERALS_H_
9+
#define PERIPHERALS_H_
10+
11+
12+
13+
#endif /* PERIPHERALS_H_ */
14+
15+
#include "main.h"
16+
17+
void initAfterJump(void);
18+
void initCorePeripherals(void);
19+
void SystemClock_Config(void);
20+
void MX_GPIO_Init(void);
21+
void MX_DMA_Init(void);
22+
void MX_ADC1_Init(void);
23+
void MX_COMP2_Init(void);
24+
void MX_COMP1_Init(void);
25+
void MX_TIM1_Init(void);
26+
void MX_TIM2_Init(void);
27+
void MX_TIM3_Init(void);
28+
void MX_TIM14_Init(void);
29+
void MX_TIM17_Init(void);
30+
void MX_TIM16_Init(void);
31+
void MX_IWDG_Init(void);
32+
void MX_TIM6_Init(void);
33+

Mcu/l431/Inc/serial_telemetry.h

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* serial_telemetry.h
3+
*
4+
* Created on: May 13, 2020
5+
* Author: Alka
6+
*/
7+
8+
9+
#include "main.h"
10+
11+
#ifndef SERIAL_TELEMETRY_H_
12+
#define SERIAL_TELEMETRY_H_
13+
14+
void makeTelemPackage(uint8_t temp,
15+
uint16_t voltage,
16+
uint16_t current,
17+
uint16_t consumption,
18+
uint16_t e_rpm);
19+
20+
21+
void telem_UART_Init(void);
22+
void send_telem_DMA();
23+
24+
#endif /* SERIAL_TELEMETRY_H_ */

Mcu/l431/Inc/stm32_assert.h

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32_assert.h
4+
* @brief STM32 assert file.
5+
******************************************************************************
6+
* @attention
7+
*
8+
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
9+
* All rights reserved.</center></h2>
10+
*
11+
* This software component is licensed by ST under BSD 3-Clause license,
12+
* the "License"; You may not use this file except in compliance with the
13+
* License. You may obtain a copy of the License at:
14+
* opensource.org/licenses/BSD-3-Clause
15+
*
16+
******************************************************************************
17+
*/
18+
19+
/* Define to prevent recursive inclusion -------------------------------------*/
20+
#ifndef __STM32_ASSERT_H
21+
#define __STM32_ASSERT_H
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
/* Exported types ------------------------------------------------------------*/
28+
/* Exported constants --------------------------------------------------------*/
29+
/* Includes ------------------------------------------------------------------*/
30+
/* Exported macro ------------------------------------------------------------*/
31+
#ifdef USE_FULL_ASSERT
32+
/**
33+
* @brief The assert_param macro is used for function's parameters check.
34+
* @param expr: If expr is false, it calls assert_failed function
35+
* which reports the name of the source file and the source
36+
* line number of the call that failed.
37+
* If expr is true, it returns no value.
38+
* @retval None
39+
*/
40+
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
41+
/* Exported functions ------------------------------------------------------- */
42+
void assert_failed(uint8_t* file, uint32_t line);
43+
#else
44+
#define assert_param(expr) ((void)0U)
45+
#endif /* USE_FULL_ASSERT */
46+
47+
#ifdef __cplusplus
48+
}
49+
#endif
50+
51+
#endif /* __STM32_ASSERT_H */
52+
53+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)