CommunityGD32Cores / gd32-pio-projects

PlatformIO test projects for the new GD32 platform and arduino core
42 stars 10 forks source link

Adding gd32-spl-blinky-eval demo #1

Closed howitzer74 closed 3 years ago

howitzer74 commented 3 years ago

Adding gd32-spl-blinky-eval demo to show how the GD- provided EVAL and DEMO board support files can be used to simplify the blinky demo.

maxgerhardt commented 3 years ago

The gd32_includes.h looks very good, thanks!

The example will probably build fine but with recent enhancements in the platform / builder code and SPL package, it can be simplified a lot:

I'll merge this now and this ToDo note will serve me as reminder for later refactor.

maxgerhardt commented 3 years ago

Hm, the example has failed to build, not finding #include <gd32f30x.h>, I'll investigate.

maxgerhardt commented 3 years ago

@howitzer74 The example code has a lot of eval boards in the platformio.ini of different series, like gd32103b_eval from the GD32F10X series, but the file gd32f30x_it.h unconditionally includes gd32f30x.h, which is not there since its of a different series. Also since gd32f307c_eval.c is compiled in unconditionally and not guarded by say #if defined(GD32307C_EVAL), it will also trigger gd32f30x.h inclusion.

The example needs a lot more work if needs to work for every known eval board, also e.g. regarding the used LED (not all have LED2) and the GPIO API (different between series). Should we reduce the platformio.ini to only the gd32307c_eval environment or how do you want to proceed?

maxgerhardt commented 3 years ago

I've added all libraries for all currently supported series in https://github.com/CommunityGD32Cores/gd32-pio-spl-package/tree/main/gd32/spl/libraries, the approach with adding support for all series should be much easier now if using these automatically found libraries.

maxgerhardt commented 3 years ago

I'll merge for now and then expand for all eval boards, should be quicker.