Skip to content

Platformio Port#29

Draft
djObsidian wants to merge 5 commits into
Saur0o0n:platformiofrom
djObsidian:platformio
Draft

Platformio Port#29
djObsidian wants to merge 5 commits into
Saur0o0n:platformiofrom
djObsidian:platformio

Conversation

@djObsidian

@djObsidian djObsidian commented Aug 29, 2022

Copy link
Copy Markdown

Fixed PIO port pull request.

So, that's a straightforward port to platformio. All .ino contents are copied to main.c, all PFP added to main.h.
Also, encoder is replaced with buttons, encoder code is commented out.
Things to do initialy:

  • File segregation
  • Remove unused dependencies
  • Add encoder or buttons setting

@djObsidian djObsidian changed the title Inital commit Platformio Port Aug 29, 2022
@Saur0o0n

Copy link
Copy Markdown
Owner

We can use it as a start for platformio branch, but for me removing encoder in favor of buttons and merging everything to one file is no go for main branch.
Mainly because removing encoder brakes initial setup - so the proper way would be to ADD buttons and allow to change it buttons/encoder in .h file before compiling.
Are you up to it? :)

@djObsidian

Copy link
Copy Markdown
Author

Yes, i'll change that. This is just my code as it is for now, i will continue working on this.

@djObsidian

Copy link
Copy Markdown
Author

Moving ESPAsyncWebServer from project libs to dependencies is not required, since we are using modified version of it

@djObsidian

Copy link
Copy Markdown
Author

@Saur0o0n
So, i'm trying to separate main.cpp and main.h to several .h and .cpp files and noticed something weired:

if(err=Load_program()){ // loading program - if >0 - failed with error - see description in PIDKiln.h

Here Load_program is called without any argument and it somehow compiles and works.
And i have no problem compiling this code when everything is in one file and function is defined in main.h. But when i move it to different files - it trows an error: to few arguments.

Should this function be called here without an argument?

@Saur0o0n

Copy link
Copy Markdown
Owner

This function (and others) are define in .h file - it has default value defined, so if it's called without argument it assumes it.

`/*
** Function defs
**
/
void load_msg(char msg[MAX_CHARS_PL]);
boolean return_LCD_string(char
msg,char* rest, int mod, uint16_t screen_w=SCREEN_W);
void LCD_Display_program_summary(int dir=0,byte load_prg=0);
void LCD_Display_quick_program(int dir=0,byte pos=0);

uint8_t Cleanup_program(uint8_t err=0);
uint8_t Load_program(char *file=0);
void ABORT_Program(uint8_t error=0);`

@djObsidian

Copy link
Copy Markdown
Author

Thanks, i missed this moment

@djObsidian

Copy link
Copy Markdown
Author

So, i managed to move all LCD related stuff to LCD.h and LCD.cpp files, just like in original arduino project. But it's not completely ideal (at least it compiles) and I need some assistance with this.
For example
https://github.com/djObsidian/PIDKiln/blob/47fa05190c7a7662e3d335a60c5688b869e2671e/src/LCD.cpp#L73
Using extern with this two const variables results in undefined reference and i have zero idea why.
https://github.com/djObsidian/PIDKiln/blob/47fa05190c7a7662e3d335a60c5688b869e2671e/src/LCD.cpp#L87
This object should be also accesible in main.cpp but i don't know how to do extern object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants