Shop OBEX P1 Docs P2 Docs Learn Events
How to Get Settings from Board Config Script — Parallax Forums

How to Get Settings from Board Config Script

DavidZemonDavidZemon Posts: 2,973
edited 2014-10-07 19:19 in Propeller 1
How can I access the settings from a board configure script inside an application? I'd like to use the script to configure PropWare::UART's default serial settings such as TX/RX pins and baud rate.

Thanks,
David

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2014-10-07 18:38
    How can I access the settings from a board configure script inside an application? I'd like to use the script to configure PropWare::UART's default serial settings such as TX/RX pins and baud rate.

    Thanks,
    David
    You just need to use variables with the same names and the .cfg file variables with the hyphens replaced by underscores and prefixed with "_cfg". For example:
    int _cfg_rxpin = -1;
    int _cfg_txpin = -1;
    

    When you load this program with propeller-load, it will patch in the values from the .cfg file before downloading the program.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2014-10-07 19:19
    David Betz wrote: »
    You just need to use variables with the same names and the .cfg file variables with the hyphens replaced by underscores and prefixed with "_cfg". For example:
    int _cfg_rxpin = -1;
    int _cfg_txpin = -1;
    

    When you load this program with propeller-load, it will patch in the values from the .cfg file before downloading the program.

    Cool! Thanks :D That's working great!
Sign In or Register to comment.