Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/eeprom struct #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Feature/eeprom struct #56

wants to merge 1 commit into from

Conversation

freasy
Copy link
Collaborator

@freasy freasy commented Aug 8, 2024

removed the uint8_t array and replaced with a struct

removed buffer variables, and refactored with direct eeprom struct access

@freasy freasy requested a review from AlkaMotors August 8, 2024 20:29
Src/main.c Show resolved Hide resolved
@Quick-Flash
Copy link

This is some major cleanup! Good work!

Copy link
Member

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great to see this PR!
I've only done a very quick first pass check in this review (I am running off to uni in a few mins, so low on time)
needs some more careful review. Main Q is if we try to make this strictly a structure change for this PR, then follow-up separately with logic changes

Inc/eeprom.h Outdated Show resolved Hide resolved
Inc/eeprom.h Outdated Show resolved Hide resolved
Mcu/g431/Src/phaseouts.c Show resolved Hide resolved
Src/main.c Outdated Show resolved Hide resolved
Src/main.c Show resolved Hide resolved
Src/signal.c Outdated
@@ -14,6 +14,7 @@
#include "sounds.h"
#include "targets.h"

EEprom_t eepromBuffer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this in signal.c? would main.c make more sense?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question

Src/sounds.c Outdated
@@ -322,18 +322,18 @@ void playBeaconTune3()
// fwdgt_counter_reload();
// signaltimeout = 0;

// if(eepromBuffer[i] == 255){
// if(eepromBuffer.buffer[i] == 255){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as i has changed, this commented out code is now incorrect. Maybe remove the commented code? or fix it to use the tune[] array?

Keil_Projects/Listings/AM32_SKYSTARS_AM60_V2_F421.map Outdated Show resolved Hide resolved
@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x08001000 0x0000FFFF { ; load region size_region
ER_IROM1 0x08001000 0x0000FFFF { ; load address = execution address
LR_IROM1 0x08001000 0x00007BDF { ; load region size_region
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why this is changing? does this impact the keil build?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its just "more correct" because thats the hard limit for the region

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a separate PR?

Src/main.c Outdated
if (eepromBuffer.eeprom_version > 2) {
if (eepromBuffer.auto_advance > 1) {
eepromBuffer.auto_advance = 0;
save_flash_nolib(eepromBuffer.buffer, sizeof(eepromBuffer.buffer), eeprom_address);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why re-save here? each save is a risk. If we lose power during a save the user can end up with incorrect settings.

@freasy freasy requested a review from tridge September 13, 2024 09:10
@freasy freasy self-assigned this Sep 30, 2024
@tridge
Copy link
Member

tridge commented Oct 8, 2024

needs a rebase

@freasy freasy force-pushed the feature/eeprom_struct branch 2 times, most recently from c16b8ea to 7238301 Compare October 29, 2024 07:25
# Conflicts:
#	Src/main.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants