Jump to content
43oh

Floats in strings on Tiva-C working in energia 0101E0015, broken in 1.6.10E18


Recommended Posts

This snippet does not give the expected results (and I know I should be checking the return code of sscanf()...), the string contains text like "60.0" when asked for a frequency.

      float request = 50.0f;
      sscanf(string, "%f", &request); // having trouble since energia version 1.6.10E18 with floats...

Under version energia_0101E0015, request becomes whatever float value is in the string (say 60.0), but under energia_1.6.10E18 request remains at the initialized value.

Same with this snippet:

      sprintf(timecodeBuffer, "f# %04d  ft %.03f  %02d:%02d:%02d.%02d.%03d  Squid_%c_[%02d:%02d:%02d.%02d]  delta:%.03f   \n", 
                           frameNumber, frameTime, computeHours, computeMinutes, computeSeconds, computeFrames, computeMilliSecs & 0x0000ffff, 
                   live, timecodeHours, timecodeMinutes, timecodeSeconds, timecodeFrames, timeDiff);

Under version energia_0101E0015 it prints everything fine, but under energia_1.6.10E18 the floats are printed as a blank space.  Computing with float values is not a problem.

My include section looks like this:

#include <Ethernet.h> 
#include <EthernetUdp.h>  
#include "inc/hw_ints.h"    // our TM4C1294NCPDT is in the SnowFlake interrupt class
#include "inc/hw_memmap.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h" 
#include "driverlib/pwm.h" 
#include <string.h>
#include <stdio.h>
#include "Wire.h"  // using the I2C bus for display

My setup:

Tiva-C connected EK-TM4C1294XL, 120 MHz tmc129
I tried upgrading to version 1.6.10E18.  I really like the new board chooser and it downloaded the appropriate drivers and build tool chain.  I think however the problem originated with the different tool chain. My OS is Kubuntu 18.04 LTS (with 32 bit libraries licb6:i386 for the lm4f tool chain to work under 64-bit ubuntu)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...