Commit Graph

108 Commits

Author SHA1 Message Date
Gregory Nutt
e3a535f66f Fix verboten C99/C11 construct in sscanf() 2017-01-09 11:23:05 -06:00
Gregory Nutt
81712be04e sscanf: Backs out logic of ca1150ce6c 2017-01-09 10:35:28 -06:00
Gregory Nutt
7fbc3ba1e1 Comments should begin with uppercase letters. 2017-01-09 09:22:46 -06:00
Gregory Nutt
07e832340f dtoa: More white space 2017-01-07 15:13:48 -06:00
Gregory Nutt
e568253eb3 Update README, some comments, and fix some spacing. 2017-01-07 10:36:18 -06:00
Pierre-noel Bouteville
562fa6b400 Add debug assertion in libdtoa to catch attempts to use floating point output formats from within an interrupt handler. That will cause assertions or crashes downstream because __dtoa will attempt to allocate memory. 2017-01-06 15:45:03 -06:00
Gregory Nutt
8ce1fdaab0 Add an attribution to the scanset addition to sscanf() 2016-12-17 16:18:04 -06:00
Author: Aleksandr Vyhovanec
7be1b86a81 Add scansets to the scanf function. Enabled CONFIG_LIBC_SCANSET option. 2016-12-17 14:39:19 -06:00
Gregory Nutt
c83da3c48f Remove minnsh configurations and support logic: up_getc() and lowinstream.
This was an interesting exercise to see just how small you could get NuttX, but otherwise it was not useful:  (1) the NSH code violated the OS interface layer by callup up_getc and up_putc directly, and (2) while waiting for character input, NSH would call up_getc() which would hog all of the CPU.  NOt a reasonably solution other than as a proof of concept.
2016-12-13 18:01:23 -06:00
Gregory Nutt
177239feae sscanf: Use strtof() instead of strtod() if a short floating point value was requested. The should help performance with MCUs with 32-bit FPU support 2016-10-22 13:42:43 -06:00
Alan Carvalho de Assis
402b876869 Include wchar.h to lib_libvsprintf.c to fix compilation error 2016-10-18 13:32:03 -06:00
David Sidrane
7ee82c0168 Fixes sscan %sn where strlen(data) < n 2016-10-15 06:31:35 -10:00
Sebastien Lorquet
aed8a602b8 stdio: Add support for remove() 2016-08-25 08:40:34 -06:00
Gregory Nutt
0e35bad987 Update some comments 2016-08-11 10:12:04 -06:00
Gregory Nutt
f9d4b50207 If there are no streams, let printf() fall back to use syslog() for output. 2016-07-11 13:52:21 -06:00
Gregory Nutt
505ca542e8 Remove some last traces of lowvsyslog that were missed; Add a SYSLOG emergency channel for handling assertion output more cleanly 2016-06-20 16:11:50 -06:00
Gregory Nutt
4f97f15b5e graphics/, libc/: Change some err() ERRORS to warn() WARNINGS or info() 2016-06-12 11:11:57 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
86b79b33cf Reserver the name 'err' for other purposes 2016-06-11 14:40:07 -06:00
Gregory Nutt
1cdc746726 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:14:08 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
4e71c4c9ef Correct some typos in comments 2016-05-18 12:49:07 -06:00
Alan Carvalho de Assis
7f5339ee5a drivers/sensors/h1750fvi.c: Add a character driver for Rohm Ambient Light Sensor BH1750FVI. 2016-04-15 08:16:16 -06:00
Gregory Nutt
0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
Gregory Nutt
384e51cb05 Add some additional schedule instrumentation 2016-02-16 15:21:45 -06:00
Dimitry Kloper
06d83c6261 Introduce support for Atmel toolchain in-flash strings
Atmel toolchain AVR compiler provides a transparent in-flash object support using __flash and __memx symbols. The former indicates to compiler that this is a flash-based object.  The later used with pointer indicates that the referenced object may reside either in flash or in RAM. The compiler automatically makes 32-bit pointer with flag indicating whether referenced object is in flash or RAM and generates code to access either in run-time. Thus, any function that accepts __memx object can transparently work with RAM and flash objects.

For platforms with a Harvard architecture and a very small RAM like AVR this allows to move all constant strings used in trace messages to flash in the instruction address space, releasing resources for other things.

This change introduces IOBJ and IPTR type qualifiers.  The 'I' indicates that the object may like in instruction space on a Harvard architecture machine.

For platforms that do not have __flash and __memx or similar symbols IOBJ and IPTR are empty, making the types equivalent to, for example, 'const char' and 'const char*'.  For Atmel compiler these will become 'const __flash char' and 'const __memx char*'.  All printf() functions and syslog() functions are changed so that the qualifier is used with the format parameter.

From: Dimitry Kloper <dikloper@cisco.com>
2016-01-05 10:29:29 -06:00
Gregory Nutt
b682190f52 Rename all head files in main NuttX repository with names like *internal.h, removing the internal 2015-12-29 17:31:17 -06:00
Gregory Nutt
006528b144 Add support for freopen() 2015-11-22 08:39:17 -06:00
Gregory Nutt
e9bd8bceb4 nuttx/libc: Fix some spacing and alignment issues 2015-10-12 07:45:02 -06:00
Gregory Nutt
0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00
Gregory Nutt
5b51a9fcdd Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
Gregory Nutt
cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Stefan Kolb
983128e16a sscanf: Formats a, A, e, E, g, and G should be treated the same as f and F 2015-09-17 07:41:33 -06:00
Paul A. Patience
9f108b7b63 Fix issues detected by clang 2015-09-10 20:59:43 -04:00
Gregory Nutt
bc46130c70 Rename libc/stdio/lib_avsprintf.c to lib_vasprintf.c 2015-09-07 13:28:00 -06:00
Sebastien Lorquet
77e4e7b231 Change all references from avsprintf to vasprintf. From Sebastien Lorquet 2015-09-07 13:22:13 -06:00
Gregory Nutt
9c66bde5b0 Fix typo in pre-processor command noted by Pierre-noel Bouteville. Also move # of pre-processior command to column 1 2015-09-05 09:10:48 -06:00
Paul A. Patience
3b89eabd50 Correct #if to #ifdef when the macro can be undefined. Fix bug in AT24XX driver: it should compare AT24XX_ADDRSIZE to 2. 2015-09-01 13:52:29 -04:00
Gregory Nutt
51f386d08a Fix more common typos 2015-08-16 11:07:23 -06:00
Gregory Nutt
fce87336a4 Add an option to disable support for long long formats in lib_vsprintf. From Alan Carvalho de Assis 2015-05-30 10:00:54 -06:00
Gregory Nutt
1018296e27 Make some file section headers more consistent with standard 2015-04-08 07:32:08 -06:00
Gregory Nutt
c39725b398 libc: stdio: Fix NULL pointer dereference in ungetc(). If 'stream' was NULL, 'stream->fs_oflags' was evaluated. From Juha Niskanen 2015-03-12 07:51:23 -06:00
Gregory Nutt
40b0acaded sscanf should also support %F 2014-12-12 07:54:37 -06:00
Gregory Nutt
1b661c6d23 sscanf: Accept %X as well as %x as a format specifier. From Sébastien Lorquet 2014-12-12 07:46:46 -06:00
Gregory Nutt
297a255fd8 avsprintf(): Fix a bug in usage of va_list on x86. On x86, va_list is a pointer to a single copy on the stack. avsprintf() calls lib_vsprintf() twice and so traverses the va_list twice using va_start. va_start modifies that single copy on the stack so that the second call to lib_vsprintf() fails. This appears to be an issue with x86 only so far 2014-12-08 10:40:06 -06:00
Gregory Nutt
91e22aeedd Traveler: Change the way that the world path is managed. 2014-12-08 09:28:53 -06:00
Gregory Nutt
9ac09db800 More fixes to problems noted by cppcheck. Some are kind of risky; some are real bugs. 2014-11-25 13:46:14 -06:00
Gregory Nutt
48888ad65b Add tmpnam() and tempnam() 2014-11-05 10:44:16 -06:00
Gregory Nutt
787cd466d2 Add tmpnam() and tempnam() 2014-11-05 10:43:17 -06:00
Gregory Nutt
ec57ab6391 Implement setlogmask(); move some syslog logic from libc/syslog to fs/syslog 2014-10-08 19:08:26 -06:00