Results 1 to 3 of 3

Thread: mixed alt_printf vs printf

  1. #1
    Join Date
    Oct 2010
    Posts
    21
    Rep Power
    1

    Default mixed alt_printf vs printf

    Dear experts,

    I am a beginner using uC/OSII with Nios II EDS 10.1 sp1.

    Question:
    1. Is there any thing I should concern if I use alt_printf and printf in mixed?
    I found that task using alt_printf required smaller stack.

    #include <stdio.h>
    #include "sys/alt_stdio.h"

    void task1(void) {
    printf("hello world\n");
    OSTimeDlyHMSM(0, 0, 1, 0);
    }

    void task2(void) {
    alt_printf("hello world\n");
    OSTimeDlyHMSM(0, 0, 1, 0);
    }


    Thank you in advance.
    skw

  2. #2
    Join Date
    Jun 2010
    Location
    Spain
    Posts
    1,222
    Rep Power
    1

    Default Re: mixed alt_printf vs printf

    I copy and paste from the Nios SW Developer's handbook:
    Code:
    alt_printf()
    This function is similar to printf(), but supports only the %c, %s, %x, and %%
    substitution strings. alt_printf() takes up substantially less code space than
    printf(), regardless whether you select the lightweight device driver API.
    alt_printf() occupies less than 1Kbyte with compiler optimization level -O2.
    Regards
    Cris

  3. #3
    Join Date
    Oct 2010
    Posts
    21
    Rep Power
    1

    Default Re: mixed alt_printf vs printf

    Cris,

    Thank you.

Similar Threads

  1. Mixed SW/HW project
    By taiji in forum University Program
    Replies: 3
    Last Post: March 19th, 2010, 01:38 PM
  2. Mixed SW/HW project
    By taiji in forum General Discussion Forum
    Replies: 0
    Last Post: February 8th, 2010, 08:31 PM
  3. mixed 3.3V and 1.2V I/O interface
    By gavriel68 in forum FPGA, Hardcopy, and CPLD Discussion
    Replies: 4
    Last Post: November 11th, 2009, 11:11 PM
  4. Mixed C and disassembled
    By mmlaskac in forum Linux Forum
    Replies: 0
    Last Post: July 8th, 2009, 04:10 AM
  5. Mixed optimisations
    By JasonDiplomat in forum General Software Forum
    Replies: 0
    Last Post: September 4th, 2006, 05:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •