Very quick question, in case you guys have seen this before: can't print floats on debug port using printf (not iprintf for integers, just the regular printf).
Using SBL2e, NBEclipse Release 2.8.2, I have my debug port on Serial 1. Here's the code:
Code: Select all
#include <predef.h>
#include <stdio.h>
#include <ctype.h>
#include <basictypes.h>
#include <serialirq.h>
#include <system.h>
#include <constants.h>
#include <ucos.h>
#include <netif.h>
#include <autoupdate.h>
#include <smarttrap.h>
extern "C" {
void UserMain(void * pd);
}
const char * AppName="MyFloatTest";
void UserMain(void * pd) {
SimpleUart(1,SystemBaud);
assign_stdio(1);
InitializeStack();
OSChangePrio(MAIN_PRIO);
EnableAutoUpdate();
printf("Application started\n");
float myFloat = 1.2345;
printf("My float = %f\n", myFloat);
while (1)
{
OSTimeDly(TICKS_PER_SECOND);
}
}
Application started
My float = f
I tried everything, changed the format specifiers, etc. to no avail.
Any hints?
Many thanks!