Interactive user script on the ozone console.

  • SO I see the "Util.log()" function can print to the console some text.
    It seems it is missing some very useful features :( see below.

    Question 1: How can I do some type of formatted text, aka: something like printf("The value is %d\n", 42 )

    Also - why does: Util.log("Hello, world\n") - complain about the \n? Likewise how do I *NOT* print a newline on the output console?
    ie: I want to print in two steps like this: Util.log("Hello "); Util.log("world\n");

    Question 2: Is there a means to wait for the user to press a key, consider the following test use case:

    void some_custom_function()
    {
    Util.log("connect test cable, and press anykey to continue\n");
    /* Wait 10 seconds aka 10000 milliseconds for user to press a key */
    key = Util.wait_keypress( 10000 );
    /* this would wait for (X) milliseconds - if no key pressed it returns -1, otherwise it returns the key */
    /* the time : 0 - means do not wait, the time (negative) would mean wait for ever */
    if( key == -1 ){
    Util.log("You did not press a key\n");
    } else {
    Util.log("You pressed the key: 0x%04x\n", key );
    }
    }

  • Hi dellis-innoflight,
    short answer: Such features are neither available nor planned to be implemented.
    When it comes to having a better insight into the internals of your application you may wish to have a look at the SmartView feature offered by Ozone. Please refer to the user's manual, sections 4.15 and 6.4.
    Best regards
    -- AlexD

    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!