Skip to main content
konay61
Associate III
November 10, 2011
Question

How to use ?

  • November 10, 2011
  • 6 replies
  • 3600 views
Posted on November 10, 2011 at 08:56

Hi all,

I'm using USART and communicating via rs 232 protocol and trying to send formatted strings by using stdarg.h C library to use;

va_list, va_start, va_arg, va_end..

but I don't know which library is supposed to add.. In some examples somehow some people could use it.. 

Thanks,

#stdarg.h
    This topic has been closed for replies.

    6 replies

    Andrew Neil
    Super User
    November 12, 2011
    Posted on November 12, 2011 at 18:32

    Can't you just use printf() or sprintf() ... ?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    konay61
    konay61Author
    Associate III
    November 14, 2011
    Posted on November 14, 2011 at 08:41

    No, I can't. In order to use these, I guess I'm supposed to add some including .h files or something like that.. 

    brunorichard9
    Visitor II
    November 21, 2011
    Posted on November 21, 2011 at 11:44

    Hi Onay,

    Using printf is generally a good idea. On the Raisonance compiler toolchain, it automatically adapts to your project hence the printf size is very small.

    You just need to add #include <stdio.h>, then printf() is available as usual.

    Note that printf emits characters on the USART by default, but you can write your own putchar function that fits your needs if it was your choice (looks like it should be OK for you).

    Best Regards,

    Andrew Neil
    Super User
    November 26, 2011
    Posted on November 26, 2011 at 17:23

    ''On the Raisonance compiler toolchain, it automatically adapts to your project hence the printf size is very small.''

    When I used Raisonance (which is, admittedly, a few years ago), you had to configure this manually - has that changed, then...?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    konay61
    konay61Author
    Associate III
    November 28, 2011
    Posted on November 28, 2011 at 14:20

    Thanks Bruno,

    I have already found out the solution by the helping of your suggestion..

    Best Regards, 

    jlchoobs
    Associate III
    June 10, 2012
    Posted on June 10, 2012 at 14:52

    Don't bother worrying about N's negative comments.

    He has been doing this all through the forum.

    Some kid who likes crittiquing everybody - without giving any actual helpful advice.