enable printf_float
This commit is contained in:
1 parent
a53b06b522
commit
9832d5eeaa
3 files changed
+11
-6
No files matched your search
@@ -224,7 +224,7 @@ size_t Print::printNumber(unsigned long n, uint8_t base)
|
||||
return write(str);
|
||||
}
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
size_t Print::printFloat(double number, uint8_t digits)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
@@ -88,6 +88,9 @@ void loop()
|
||||
if ( !bleCTime.discovered() ) return;
|
||||
|
||||
// Get Time from iOS one every 1 second
|
||||
// Note it is advised to update this quickly
|
||||
// Application should use local clock and update time after
|
||||
// a long period (e.g an hour or day)s
|
||||
bleCTime.getCurrentTime();
|
||||
|
||||
printTime();
|
||||
@@ -139,9 +142,11 @@ void printTime(void)
|
||||
|
||||
Serial.printf("%04d-%02d-%02d ", bleCTime.Time.year, bleCTime.Time.month, bleCTime.Time.day);
|
||||
Serial.printf("%02d:%02d:%02d ", bleCTime.Time.hour, bleCTime.Time.minute, bleCTime.Time.second);
|
||||
Serial.println(day_of_week_str[bleCTime.Time.weekday]);
|
||||
Serial.printf("UTC %d min, ", bleCTime.LocalInfo.timezone*15);
|
||||
Serial.printf("Daytime Saving +%d min", bleCTime.LocalInfo.dst_offset*15);
|
||||
Serial.print(day_of_week_str[bleCTime.Time.weekday]);
|
||||
|
||||
int utc_offset = bleCTime.LocalInfo.timezone*15; // in 15 minutes unit
|
||||
Serial.printf(" (UTC %+d:%02d, ", utc_offset/60, utc_offset%60);
|
||||
Serial.printf("DST %+.1f)", ((float) bleCTime.LocalInfo.dst_offset*15)/60 );
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ compiler.warning_flags.all=-Wall -Wextra -Wno-unused-parameter -Wno-missing-fiel
|
||||
|
||||
compiler.path={runtime.tools.gcc-arm-none-eabi-5_2-2015q4.path}/bin/
|
||||
compiler.c.cmd=arm-none-eabi-gcc
|
||||
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -DSOFTDEVICE_PRESENT
|
||||
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -DSOFTDEVICE_PRESENT
|
||||
compiler.c.elf.cmd=arm-none-eabi-gcc
|
||||
compiler.c.elf.flags=-Os -Wl,--gc-sections -save-temps
|
||||
compiler.S.cmd=arm-none-eabi-gcc
|
||||
@@ -52,7 +52,7 @@ compiler.size.cmd=arm-none-eabi-size
|
||||
build.extra_flags=
|
||||
build.lfclk_flags=-DUSE_LFXO
|
||||
build.debug_flags=-DCFG_DEBUG=0 -Os
|
||||
build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float
|
||||
build.ldscript=bluefruit52_s132_v201.ld
|
||||
|
||||
nrf.sdk.path={build.core.path}/SDK
|
||||
|
||||
Reference in new issue
Block a user