stdio.h in C

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

stdio.h in C

Post by YahooArchive »

> coridium.h defines macros for getc() and other things such that
when
> stdio.h is included, there are compiler errors.
>
> Is there a way to do so?
> Example: to use sscanf() - not scanf()

gcc was written with Linux/Unix in mind, so its libraries are
tailored to that environment.

stdio will bring in a lot of stuff to support its call for streaming,
files, and things that just don't exist in the embedded environment
of the ARMmite. Even if it were to support that, most likely you
would not have any room left over to write your program. There are
alternatives out there like FreeRTOS, or uCOS2, which I know run on
an LPC2106, but that has 4x memory, both Flash and SRAM. We ported
FreeRTOS to MakeItC just to check out MakeItC, but that was a couple
years back, so its not up to date. Most changes dealt with MakeItC
requiring header files and C files to be named the same and live in
the same directory.

ARMbasic compiler written in C, without stdio, and at the start
without printf is our frame of reference. For the string.h, we
pulled a subset out of the WinARM sources. We found an open source
implementation of printf that was pretty small and now include that
in our distribution. There may be a similar sscanf out there, or you
might check the sources for WinARM/Yagarto and see if its sscanf is
useable. Or you could write an integer version of sscanf, modeled
after the printf.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: stdio.h in C

Post by YahooArchive »

Re below... thanks. Don't need RTOS for this project. Just wishing I
had sscanf() for parsing out numbers coming in on the serial port. Can
be done with atoi() and a bunch of loops and code of my own, but
sscanf() serves that purpose. Maybe a no-floating-point version can be
had as is printf() in the ARMmite suppot code?

The source for the standard sscanf is in the gcc install, but I don't know if it could be condensed to eliminate the float calls and the many other library objects that get included by it.

Post Reply