Any xTIMEcomposer __VERSION__ like macro?

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
aclassifier
XCore Addict
Posts: 158
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Any xTIMEcomposer __VERSION__ like macro?

Postby aclassifier » Thu May 18, 2017 5:31 pm

Is there any __VERSION__ predefine for xTIMEcomposer that will yield something like "14.2.4"?

__VERSION__ yields "4.2.1 Compatible Clang 3.6.0" on xTIMEcomposer 14.2.4
User avatar
infiniteimprobability
XCore Expert
Posts: 801
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Tue May 23, 2017 11:20 am

Does this help?

viewtopic.php?t=3276
User avatar
aclassifier
XCore Addict
Posts: 158
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Postby aclassifier » Tue May 23, 2017 8:58 pm

Thanks, but no! "14.3.1" from __XTIMECOMPOSER__ is on my wish list!

Code: Select all

void test(void)
{
    const char  version_str []        = __VERSION__;
    unsigned    xc_val                = __XC__;
    unsigned    xcc_version_major_val = XCC_VERSION_MAJOR;
    // unsigned xtimecomposer_str []  = __XTIMECOMPOSER__;

    printf("__VERSION__=\"%s\", __XC__=%u, XCC_VERSION_MAJOR=%u\n", version_str, xc_val, xcc_version_major_val);
    printf("__VERSION__=\"%s\", __XC__=%u, XCC_VERSION_MAJOR=%u,\n%s\n", __VERSION__, __XC__, XCC_VERSION_MAJOR,
            "but xTIMEcomposer is \"Version: Community_14.2.4 (build 15898, Dec-20-2016)\"");

    // PRINTS:
    /*
    __VERSION__="4.2.1 Compatible Clang 3.6.0 ", __XC__=1, XCC_VERSION_MAJOR=1402
    __VERSION__="4.2.1 Compatible Clang 3.6.0 ", __XC__=1, XCC_VERSION_MAJOR=1402,
    but xTIMEcomposer is "Version: Community_14.2.4 (build 15898, Dec-20-2016)"
    */
}

int main() {
    par {
        test();
    }
    return 0;
}
User avatar
ers35
Active Member
Posts: 60
Joined: Mon Jun 10, 2013 2:14 pm
Contact:

Postby ers35 » Thu May 25, 2017 2:09 am

As a workaround you can generate a header file containing the version using a Makefile. See the attached example.

Code: Select all

$ xmake
$ xsim bin/main.xe
Community_14.2.4 (build 15898, Dec-20-2016)
Attachments
version.zip
(1.69 KiB) Downloaded 16 times
version.zip
(1.69 KiB) Downloaded 16 times

Return to “Development Tools and Programming”

Who is online

Users browsing this forum: No registered users and 8 guests