energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
794 stars 672 forks source link

Educational BoosterPack Screen Library // explicit check for board support #654

Open adrianF-TI opened 9 years ago

adrianF-TI commented 9 years ago

For each new Energia release, we need to update the explicit list of supported boards. For example, MSP432 is not in the current Screen_HX8353E.cpp file as a supported board, thus compilation fails. However, by simply adding it to the #if defined() section, it works just fine.

adrianF-TI commented 9 years ago

Also seems to work with MSP430FR6989 LaunchPad on Energia v16

rei-vilo commented 9 years ago

The #if defined() is required to check the LaunchPad has a 40-pin BoosterPack connector, as _pinDataCommanduses pin 31.

Now, we could define another set of variables for the BoosterPack capability to each LaunchPad, for example HAS_20_PIN_BOOSTERPACK and HAS_40_PIN_BOOSTERPACK.

The resulting Screen_HX8353E.cpp would be then

#if defined(HAS_40_PIN_BOOSTERPACK) 
// ...
#else
#error Platform not supported
#endif

This would ease the test and save updates every-time a new LaunchPad is available.

rei-vilo commented 9 years ago

@adrianF-TI

See pull-request 7dce178 on #659 Added HAS_40_PIN_BOOSTERPACK and HAS_20_PIN_BOOSTERPACK.