embedXcode
  • About
  • Blog
  • IDEs
    • The Battle of IDEs
    • A Glimpse of Xcode
    • Three Repositories 0023, 1.0 and 1.5
    • Visual Micro on Windows
  • Features
    • Editions
    • Supported Boards and IDEs
    • Check Platforms and MCUs
    • Hall of Fame >
      • Projects
      • Reviews
    • Manage Code for Multiple Platforms
  • Support
    • Knowledge Base
    • Help Desk
    • User Manual
    • Forums
  • Download

Manage Code for Multiple Boards

This is an embedXcode+ feature.

Managing code for multiples platforms is the raison d'être of embedXcode and a real issue, as it needs to take into account two dimensions: 
  • the boards, as Arduino Uno or Wiring S,
  • and the frameworks, some of them with incompatible releases, as Arduino 0023, Arduino 1.0 or Wiring.

Gone are the days of the single framework Wiring shared by all platforms!

This can be done in two ways. Both are valid from an embedXcode point of view.
Manage Code for Multiple Boards

First Approach: MCU-Based

The first approach is MCU-based and relies solely on the micro-controller (MCU) type.

This approach is compatible with all the respective IDEs, as no new environment variable is created or required.

It requires updating the list of MCU everywhere and every-time a new one is released.



    

Second Approach: IDE-Based

The second approach is IDE-based. Most of the IDEs defines a specific environment variable combine boards type and framework version. 

For example, Arduino IDE defines ARDUINO=101 and passes it on to the tool-chain with -D, as -DARDUINO=101.

As at today, this approach is compatible with all platforms.

However, some platforms like Energia define two variables: ENERGIA and ARDUINO.

This implies testing ENERGIA first and ARDUINO at the end.

    
The second approach allows more compact and easier to read code, and doesn't require maintenance at code level when a new MCU appears.

    

Conclusion

Both approaches are valid from an embedXcode point of view. 
Powered by Create your own unique website with customizable templates.