Skip to content

Commit

Permalink
remove not needed variables and buffer access
Browse files Browse the repository at this point in the history
removing not needed buffer variables from eeprom, removed eeprom struct buffer access
  • Loading branch information
freasy committed Aug 8, 2024
1 parent 7eba1e1 commit 5020f13
Show file tree
Hide file tree
Showing 32 changed files with 1,106 additions and 1,312 deletions.
2 changes: 1 addition & 1 deletion Inc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma once

extern EEprom_t eepromBuffer;
extern uint32_t eeprom_address;
extern uint16_t TIMER1_MAX_ARR;
extern uint16_t dshot_frametime_high;
extern uint16_t dshot_frametime_low;
Expand Down
1 change: 0 additions & 1 deletion Inc/dshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ extern void saveEEpromSettings(void);
extern char dshot_telemetry;
extern char armed;
extern char dir_reversed;
extern char bi_direction;
extern char buffer_divider;
extern uint8_t last_dshot_command;
extern uint32_t commutation_interval;
Expand Down
4 changes: 3 additions & 1 deletion Mcu/f421/Inc/eeprom.h → Inc/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ typedef union EEprom_u {
uint8_t sine_mode_power; // 45
uint8_t input_type; // 46
uint8_t reserved_2[5]; //47-51
uint8_t tune[124];
uint8_t tune[124]; // 52-175
};
uint8_t buffer[176];
} EEprom_t;

extern EEprom_t eepromBuffer;

// 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);
Expand Down
1 change: 0 additions & 1 deletion Inc/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "main.h"

extern char out_put;
extern char bi_direction;
extern char inputSet;
extern char dshot;
extern char servoPwm;
Expand Down
1,782 changes: 899 additions & 883 deletions Keil_Projects/Listings/AM32_SKYSTARS_AM60_V2_F421.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Mcu/e230/Inc/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void setInputPullUp();
void enableHalfTransferInt();
void setInputPullNone();

extern char bi_direction;
extern char inputSet;
extern char dshot;
extern char servoPwm;
Expand Down
17 changes: 0 additions & 17 deletions Mcu/e230/Inc/eeprom.h

This file was deleted.

13 changes: 6 additions & 7 deletions Mcu/e230/Src/phaseouts.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "targets.h"

extern char comp_pwm;
extern char prop_brake_active;

#ifndef PWM_ENABLE_BRIDGE
Expand Down Expand Up @@ -69,7 +68,7 @@ void proportionalBrake()

void phaseBPWM()
{
if (!comp_pwm) { // for future
if (!eepromBuffer.comp_pwm) { // for future
gpio_mode_QUICK(PHASE_B_GPIO_PORT_LOW, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,
PHASE_B_GPIO_LOW);
GPIO_BC(PHASE_B_GPIO_PORT_LOW) = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -118,7 +117,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
gpio_mode_QUICK(PHASE_C_GPIO_PORT_LOW, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,
PHASE_C_GPIO_LOW);
GPIO_BC(PHASE_C_GPIO_PORT_LOW) = PHASE_C_GPIO_LOW;
Expand Down Expand Up @@ -157,7 +156,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
gpio_mode_QUICK(PHASE_A_GPIO_PORT_LOW, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,
PHASE_A_GPIO_LOW);
GPIO_BC(PHASE_A_GPIO_PORT_LOW) = PHASE_A_GPIO_LOW;
Expand Down Expand Up @@ -194,7 +193,7 @@ void phaseALOW()
//////////////////////////////////PHASE 1//////////////////////
void phaseBPWM()
{
if (!comp_pwm) { // for future
if (!eepromBuffer.comp_pwm) { // for future
// gpio_mode_QUICK(PHASE_B_GPIO_PORT_LOW, GPIO_MODE_OUTPUT,
// GPIO_PUPD_NONE, PHASE_B_GPIO_LOW);
// GPIO_BC(PHASE_B_GPIO_PORT_LOW) = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -233,7 +232,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// gpio_mode_QUICK(PHASE_C_GPIO_PORT_LOW, GPIO_MODE_OUTPUT,
// GPIO_PUPD_NONE,
// PHASE_C_GPIO_LOW); GPIO_BC(PHASE_C_GPIO_PORT_LOW) = PHASE_C_GPIO_LOW;
Expand Down Expand Up @@ -272,7 +271,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// gpio_mode_QUICK(PHASE_A_GPIO_PORT_LOW, GPIO_MODE_OUTPUT,
// GPIO_PUPD_NONE,
// PHASE_A_GPIO_LOW); GPIO_BC(PHASE_A_GPIO_PORT_LOW) = PHASE_A_GPIO_LOW;
Expand Down
1 change: 0 additions & 1 deletion Mcu/f031/Inc/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void setInputPullUp();
void enableHalfTransferInt();
void setInputPullNone();

extern char bi_direction;
extern char inputSet;
extern char dshot;
extern char servoPwm;
Expand Down
17 changes: 0 additions & 17 deletions Mcu/f031/Inc/eeprom.h

This file was deleted.

13 changes: 6 additions & 7 deletions Mcu/f031/Src/phaseouts.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "targets.h"

extern char comp_pwm;
extern char prop_brake_active;

#ifndef PWM_ENABLE_BRIDGE
Expand Down Expand Up @@ -61,7 +60,7 @@ void proportionalBrake()

void phaseBPWM()
{
if (!comp_pwm) { // for future
if (!eepromBuffer.comp_pwm) { // for future
LL_GPIO_SetPinMode(PHASE_B_GPIO_PORT_LOW, PHASE_B_GPIO_LOW,
LL_GPIO_MODE_OUTPUT);
PHASE_B_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -99,7 +98,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
LL_GPIO_SetPinMode(PHASE_C_GPIO_PORT_LOW, PHASE_C_GPIO_LOW,
LL_GPIO_MODE_OUTPUT);
PHASE_C_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_C_GPIO_LOW;
Expand Down Expand Up @@ -137,7 +136,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
LL_GPIO_SetPinMode(PHASE_A_GPIO_PORT_LOW, PHASE_A_GPIO_LOW,
LL_GPIO_MODE_OUTPUT);
PHASE_A_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_A_GPIO_LOW;
Expand Down Expand Up @@ -174,7 +173,7 @@ void phaseALOW()
//////////////////////////////////PHASE 1//////////////////////
void phaseBPWM()
{
if (!comp_pwm) { // for future
if (!eepromBuffer.comp_pwm) { // for future
// LL_GPIO_SetPinMode(PHASE_B_GPIO_PORT_LOW,
// PHASE_B_GPIO_LOW, LL_GPIO_MODE_OUTPUT);
// PHASE_B_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -213,7 +212,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// LL_GPIO_SetPinMode(PHASE_C_GPIO_PORT_LOW, PHASE_C_GPIO_LOW,
// LL_GPIO_MODE_OUTPUT); PHASE_C_GPIO_PORT_LOW->LOW_BITREG_OFF =
// PHASE_C_GPIO_LOW;
Expand Down Expand Up @@ -252,7 +251,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// LL_GPIO_SetPinMode(PHASE_A_GPIO_PORT_LOW, PHASE_A_GPIO_LOW,
// LL_GPIO_MODE_OUTPUT); PHASE_A_GPIO_PORT_LOW->LOW_BITREG_OFF =
// PHASE_A_GPIO_LOW;
Expand Down
2 changes: 0 additions & 2 deletions Mcu/f051/Inc/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ void setInputPullUp();
void enableHalfTransferInt();
void setInputPullNone();

extern char bi_direction;

extern char send_telemetry;
extern uint8_t degrees_celsius;

Expand Down
17 changes: 0 additions & 17 deletions Mcu/f051/Inc/eeprom.h

This file was deleted.

13 changes: 6 additions & 7 deletions Mcu/f051/Src/phaseouts.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "targets.h"

extern char comp_pwm;
extern char prop_brake_active;

#ifndef PWM_ENABLE_BRIDGE
Expand Down Expand Up @@ -60,7 +59,7 @@ void proportionalBrake()

void phaseBPWM()
{
if (!comp_pwm) { // for future
if (!eepromBuffer.comp_pwm) { // for future
LL_GPIO_SetPinMode(PHASE_B_GPIO_PORT_LOW, PHASE_B_GPIO_LOW,
LL_GPIO_MODE_OUTPUT);
PHASE_B_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -98,7 +97,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
LL_GPIO_SetPinMode(PHASE_C_GPIO_PORT_LOW, PHASE_C_GPIO_LOW,
LL_GPIO_MODE_OUTPUT);
PHASE_C_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_C_GPIO_LOW;
Expand Down Expand Up @@ -136,7 +135,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
LL_GPIO_SetPinMode(PHASE_A_GPIO_PORT_LOW, PHASE_A_GPIO_LOW,
LL_GPIO_MODE_OUTPUT);
PHASE_A_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_A_GPIO_LOW;
Expand Down Expand Up @@ -173,7 +172,7 @@ void phaseALOW()
//////////////////////////////////PHASE 1//////////////////////
void phaseBPWM()
{
if (!comp_pwm) { // for future
if (!eepromBuffer.comp_pwm) { // for future
// LL_GPIO_SetPinMode(PHASE_B_GPIO_PORT_LOW,
// PHASE_B_GPIO_LOW, LL_GPIO_MODE_OUTPUT);
// PHASE_B_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -212,7 +211,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// LL_GPIO_SetPinMode(PHASE_C_GPIO_PORT_LOW, PHASE_C_GPIO_LOW,
// LL_GPIO_MODE_OUTPUT); PHASE_C_GPIO_PORT_LOW->LOW_BITREG_OFF =
// PHASE_C_GPIO_LOW;
Expand Down Expand Up @@ -251,7 +250,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// LL_GPIO_SetPinMode(PHASE_A_GPIO_PORT_LOW, PHASE_A_GPIO_LOW,
// LL_GPIO_MODE_OUTPUT); PHASE_A_GPIO_PORT_LOW->LOW_BITREG_OFF =
// PHASE_A_GPIO_LOW;
Expand Down
1 change: 0 additions & 1 deletion Mcu/f415/Inc/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void setInputPullUp();
void enableHalfTransferInt();
void setInputPullNone();

extern char bi_direction;
extern char inputSet;
extern char dshot;
extern char servoPwm;
Expand Down
7 changes: 0 additions & 7 deletions Mcu/f415/Inc/eeprom.h

This file was deleted.

15 changes: 7 additions & 8 deletions Mcu/f415/Src/phaseouts.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "functions.h"
#include "targets.h"

extern char comp_pwm;
extern char prop_brake_active;

#ifndef PWM_ENABLE_BRIDGE
Expand Down Expand Up @@ -61,7 +60,7 @@ void proportionalBrake()
}

// void phaseCPWM() {
// if (!comp_pwm){
// if (!eepromBuffer.comp_pwm){
// gpio_mode_QUICK(PHASE_C_GPIO_PORT_LOW,
// GPIO_MODE_OUTPUT,
// GPIO_PULL_NONE, PHASE_C_GPIO_LOW);
Expand All @@ -88,7 +87,7 @@ void proportionalBrake()

void phaseBPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
gpio_mode_QUICK(PHASE_B_GPIO_PORT_LOW, GPIO_MODE_OUTPUT, GPIO_PULL_NONE,
PHASE_B_GPIO_LOW);
PHASE_B_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -124,7 +123,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
gpio_mode_QUICK(PHASE_C_GPIO_PORT_LOW, GPIO_MODE_OUTPUT, GPIO_PULL_NONE,
PHASE_C_GPIO_LOW);
PHASE_C_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_C_GPIO_LOW;
Expand Down Expand Up @@ -163,7 +162,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
gpio_mode_QUICK(PHASE_A_GPIO_PORT_LOW, GPIO_MODE_OUTPUT, GPIO_PULL_NONE,
PHASE_A_GPIO_LOW);
PHASE_A_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_A_GPIO_LOW;
Expand Down Expand Up @@ -200,7 +199,7 @@ void phaseALOW()
//////////////////////////////////PHASE 1//////////////////////
void phaseBPWM()
{
if (!comp_pwm) { // for future
if (!eepromBuffer.comp_pwm) { // for future
// gpio_mode_QUICK(PHASE_B_GPIO_PORT_LOW, GPIO_MODE_OUTPUT,
// GPIO_PULL_NONE, PHASE_B_GPIO_LOW);
// PHASE_B_GPIO_PORT_LOW->LOW_BITREG_OFF = PHASE_B_GPIO_LOW;
Expand Down Expand Up @@ -239,7 +238,7 @@ void phaseBLOW()

void phaseCPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// gpio_mode_QUICK(PHASE_C_GPIO_PORT_LOW, GPIO_MODE_OUTPUT,
// GPIO_PULL_NONE,
// PHASE_C_GPIO_LOW); PHASE_C_GPIO_PORT_LOW->LOW_BITREG_OFF =
Expand Down Expand Up @@ -279,7 +278,7 @@ void phaseCLOW()

void phaseAPWM()
{
if (!comp_pwm) {
if (!eepromBuffer.comp_pwm) {
// gpio_mode_QUICK(PHASE_A_GPIO_PORT_LOW, GPIO_MODE_OUTPUT,
// GPIO_PULL_NONE,
// PHASE_A_GPIO_LOW); PHASE_A_GPIO_PORT_LOW->LOW_BITREG_OFF =
Expand Down
Loading

0 comments on commit 5020f13

Please sign in to comment.