ccrause / fpc-esp-freertos

Mozilla Public License 2.0
20 stars 8 forks source link

Restructured example code to be able to automagically generate lpi files #5

Closed michael-ring closed 2 years ago

michael-ring commented 2 years ago

Made lpi files orthogonal to global fpc configuration files, all that is there to add in fpc.cfg is documented in

https://github.com/LongDirtyAnimAlf/fpcupdeluxe/issues/487

Some demo's do not build (for esp32):

Building adc8266test/adc8266test.lpi                                 [FAILED]
Building adctest/adctest.lpi                                         [OK]     1 bytes code, 293 bytes data
Building blink/blink.lpi                                             [OK]     1 bytes code, 269 bytes data
Building fpcthreads/fpcthreads.lpi                                   [FAILED]
Building gpio_interrupt/gpio_interrupt.lpi                           [OK]     1 bytes code, 277 bytes data
Building i2cscan/i2cscan.lpi                                         [OK]     1 bytes code, 277 bytes data
Building nvstest/nvstest.lpi                                         [FAILED]
Building otatest/otatest.lpi                                         [OK]     1 bytes code, 453 bytes data
Building realtimestats/realtimestats.lpi                             [OK]     1 bytes code, 245 bytes data
Building simplehttpclient/simplehttpclient.lpi                       [OK]     1 bytes code, 421 bytes data
Building simplehttpserver/simplehttpserver.lpi                       [OK]     1 bytes code, 421 bytes data
Building testexit/testexit.lpi                                       [FAILED]
Building wifiscan/wifiscan.lpi                                       [OK]     1 bytes code, 357 bytes data
ccrause commented 2 years ago

There is some evidence of copy/paste fixup fatigue in the original code, this is a welcome cleanup. Thank you Michael! I will hopefully get round to checking this tonight.

michael-ring commented 2 years ago

One more thought, in MBF I do not use build configurations but instead postfix the lpi files with the subarch they are meant for. This way you pick a .lpi, load & compile for exactly the right subarch.

Not a big difference, but it makes it easier to see for which subarch a certain example is meant.

ccrause commented 2 years ago

One more thought, in MBF I do not use build configurations but instead postfix the lpi files with the subarch they are meant for. This way you pick a .lpi, load & compile for exactly the right subarch.

Not a big difference, but it makes it easier to see for which subarch a certain example is meant.

This is a good idea. My wish is to make the examples subarch agnostic as far as possible, but sometimes the differences are too large to handle neatly with conditional code.

michael-ring commented 2 years ago

If you want to go down that road then I can prepare the files for you and create another pull request, just let me know...

ccrause commented 2 years ago

The projects with build errors will be fixed. Some updates are required to make portmacro and task compatible with the latest SDK changes.