Skip to content

Commit

Permalink
revert timeout to 0.5s, start l431
Browse files Browse the repository at this point in the history
  • Loading branch information
AlkaMotors committed Mar 26, 2023
1 parent 6448722 commit 0453aca
Show file tree
Hide file tree
Showing 24 changed files with 3,211 additions and 8 deletions.
14 changes: 12 additions & 2 deletions Inc/targets.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@


#ifndef USE_MAKE
//#define FD6288_F051
#define IFLIGHT_F051
#define FD6288_F051
//#define IFLIGHT_F051
//#define MP6531_F051
//#define DAKEFPV_35A_F051

//#define TMOTOR55_F051 // like iflight but with leds
//#define TMOTOR45_F051
//#define HGLRC_F051
Expand Down Expand Up @@ -59,6 +61,14 @@
#define USE_SERIAL_TELEMETRY
#endif

#ifdef DAKEFPV_35A_F051
#define FILE_NAME "DAKEFPV_35A_F051"
#define FIRMWARE_NAME "DakeFPV 35A"
#define DEAD_TIME 18
#define HARDWARE_GROUP_F0_B
#define USE_SERIAL_TELEMETRY
#endif

#ifdef RAZOR32_F051
#define FILE_NAME "RAZOR32_F051"
#define FIRMWARE_NAME "Razor32 "
Expand Down
4 changes: 2 additions & 2 deletions Mcu/f031/Src/IO.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void checkDshot(){
output_timer_prescaler=0;
dshot = 1;
buffer_divider = 44;
buffer_padding = 9;
// buffer_padding = 9;
buffersize = 32;
inputSet = 1;
}
Expand All @@ -205,7 +205,7 @@ void checkDshot(){
output_timer_prescaler=1;
IC_TIMER_REGISTER->CNT = 0xffff;
buffer_divider = 44;
buffer_padding = 7;
// buffer_padding = 7;
buffersize = 32;
inputSet = 1;
}
Expand Down
29 changes: 29 additions & 0 deletions Mcu/l431/Inc/ADC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* ADC.h
*
* Created on: May 20, 2020
* Author: Alka
*/

#include "main.h"
#include "targets.h"


#ifndef ADC_H_
#define ADC_H_



void ADC_DMA_Callback();
void enableADC_DMA();
void activateADC();
void ADC_Init(void);

void Configure_DMA();

void Configure_ADC();

void Activate_ADC();


#endif /* ADC_H_ */
28 changes: 28 additions & 0 deletions Mcu/l431/Inc/IO.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* IO.h
*
* Created on: Sep. 26, 2020
* Author: Alka
*/

#ifndef IO_H_
#define IO_H_

#endif /* IO_H_ */


#include "main.h"

void changeToOutput();
void changeToInput();
void receiveDshotDma();
void sendDshotDma();
void detectInput();

extern char inputSet;
extern char dshot;
extern char servoPwm;
extern char send_telemetry;
extern uint8_t degrees_celsius;

extern uint16_t ADC_raw_volts;
23 changes: 23 additions & 0 deletions Mcu/l431/Inc/WS2812.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* WS2812.h
*
* Created on: Sep 9, 2020
* Author: Alka
*/

#ifndef INC_WS2812_H_
#define INC_WS2812_H_

#include "main.h"




void send_LED_DMA();
void WS2812_Init(void);
void send_LED_RGB(uint8_t red, uint8_t green, uint8_t blue);

extern char dma_busy;


#endif /* INC_WS2812_H_ */
22 changes: 22 additions & 0 deletions Mcu/l431/Inc/comparator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* comparator.h
*
* Created on: Sep. 26, 2020
* Author: Alka
*/

#ifndef COMPARATOR_H_
#define COMPARATOR_H_



#endif /* COMPARATOR_H_ */

#include "main.h"

void maskPhaseInterrupts();
void changeCompInput();
void enableCompInterrupts();

extern char rising;
extern char step;
20 changes: 20 additions & 0 deletions Mcu/l431/Inc/eeprom.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* bootloader.h
*
* Created on: Mar. 25, 2020
* Author: Alka
*/
#include "main.h"
#ifndef INC_EEPROM_H_
#define INC_EEPROM_H_



#endif /* INC_BOOTLOADER_H_ */


//void save_to_flash(uint8_t *data);
//void read_flash(uint8_t* data, uint32_t address);
//void save_to_flash_bin(uint8_t *data, int length, uint32_t add);
void read_flash_bin(uint8_t* data , uint32_t add ,int out_buff_len);
void save_flash_nolib(uint8_t *data, int length, uint32_t add);
88 changes: 88 additions & 0 deletions Mcu/l431/Inc/main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32g0xx_ll_adc.h"
#include "stm32g0xx_ll_comp.h"
#include "stm32g0xx_ll_exti.h"
#include "stm32g0xx_ll_dma.h"
#include "stm32g0xx_ll_iwdg.h"
#include "stm32g0xx_ll_rcc.h"
#include "stm32g0xx_ll_bus.h"
#include "stm32g0xx_ll_system.h"
#include "stm32g0xx_ll_cortex.h"
#include "stm32g0xx_ll_utils.h"
#include "stm32g0xx_ll_pwr.h"
#include "stm32g0xx_ll_tim.h"
#include "stm32g0xx_ll_gpio.h"
#include "stm32g0xx_ll_usart.h"

#if defined(USE_FULL_ASSERT)
#include "stm32_assert.h"
#endif /* USE_FULL_ASSERT */

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
33 changes: 33 additions & 0 deletions Mcu/l431/Inc/peripherals.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* peripherals.h
*
* Created on: Sep. 26, 2020
* Author: Alka
*/

#ifndef PERIPHERALS_H_
#define PERIPHERALS_H_



#endif /* PERIPHERALS_H_ */

#include "main.h"

void initAfterJump(void);
void initCorePeripherals(void);
void SystemClock_Config(void);
void MX_GPIO_Init(void);
void MX_DMA_Init(void);
void MX_ADC1_Init(void);
void MX_COMP2_Init(void);
void MX_COMP1_Init(void);
void MX_TIM1_Init(void);
void MX_TIM2_Init(void);
void MX_TIM3_Init(void);
void MX_TIM14_Init(void);
void MX_TIM17_Init(void);
void MX_TIM16_Init(void);
void MX_IWDG_Init(void);
void MX_TIM6_Init(void);

24 changes: 24 additions & 0 deletions Mcu/l431/Inc/serial_telemetry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* serial_telemetry.h
*
* Created on: May 13, 2020
* Author: Alka
*/


#include "main.h"

#ifndef SERIAL_TELEMETRY_H_
#define SERIAL_TELEMETRY_H_

void makeTelemPackage(uint8_t temp,
uint16_t voltage,
uint16_t current,
uint16_t consumption,
uint16_t e_rpm);


void telem_UART_Init(void);
void send_telem_DMA();

#endif /* SERIAL_TELEMETRY_H_ */
53 changes: 53 additions & 0 deletions Mcu/l431/Inc/stm32_assert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
******************************************************************************
* @file stm32_assert.h
* @brief STM32 assert file.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_ASSERT_H
#define __STM32_ASSERT_H

#ifdef __cplusplus
extern "C" {
#endif

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */

#ifdef __cplusplus
}
#endif

#endif /* __STM32_ASSERT_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Loading

0 comments on commit 0453aca

Please sign in to comment.