Go to Post The mecanum is like the dress shoe, the treaded wheel is like the athletic shoe. - Chris Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-03-2004, 15:41
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Anyone with a replacement Printf?

I wrote a buffered i/o system for the IFI controller. It is file oriented so output can be directed to either the program port or the TTY port. It is buffered so calls to printf can occur even in interrupt handlers (no blocking) It can handle the actual i/o either as polled in the fast loop, or via a low interrupts. I'll be publishing it soon. I have fputc() fgetc(), etc. done.

The problem is that the existing IFI printf library doesn't exactly lend itself to creating an fprintf() routine, and a "printf()" on top of that (i.e. default output to one or the other ports).

Maybe I just need a primer on how printf(...) works... But I thought I would ask and see if someone has a version that would be more amenable to the streams approach to output.

The original goal was to have the debug menu on one port and still have access to another port for serial peripherals (say, a GPS unit?) But just having it buffered and polling makes a HUGE difference in performance and ability to debug with printf statements.
  #2   Spotlight this post!  
Unread 17-03-2004, 15:46
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Anyone with a replacement Printf?

Quote:
Originally Posted by Larry Barello
I wrote a buffered i/o system for the IFI controller. It is file oriented so output can be directed to either the program port or the TTY port. It is buffered so calls to printf can occur even in interrupt handlers (no blocking) It can handle the actual i/o either as polled in the fast loop, or via a low interrupts. I'll be publishing it soon. I have fputc() fgetc(), etc. done.

The problem is that the existing IFI printf library doesn't exactly lend itself to creating an fprintf() routine, and a "printf()" on top of that (i.e. default output to one or the other ports).

Maybe I just need a primer on how printf(...) works... But I thought I would ask and see if someone has a version that would be more amenable to the streams approach to output.

The original goal was to have the debug menu on one port and still have access to another port for serial peripherals (say, a GPS unit?) But just having it buffered and polling makes a HUGE difference in performance and ability to debug with printf statements.
Here:

Quote:
Originally Posted by Mark McLeod
I just put some routines here http://www.chiefdelphi.com/forums/showthread.php?t=26529 that do this.

You can just call the one routine that prints decimals without changing any of your own printfs.
PS- why do you have to have at least 2 characters?
  #3   Spotlight this post!  
Unread 17-03-2004, 16:58
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Anyone with a replacement Printf?

The modified printf's referenced, above, don't help me. They just fix some of the more blatent errors in IFI's code.
  #4   Spotlight this post!  
Unread 17-03-2004, 17:45
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Anyone with a replacement Printf?

Since the system is relativly limited, streams don't do much good, as their whole point is to allow you to work with multiple devices in a similar fashion. If your thinking of writing printf over from scratch, I'll warn you that it is very hard to work with variable parameter lists in C. I, personally, would hate to have to do it.
__________________

  #5   Spotlight this post!  
Unread 17-03-2004, 17:49
Crazy_Ed's Avatar
Crazy_Ed Crazy_Ed is offline
Amature Progammer
AKA: Ed Orsi
#0710 (PAW)
Team Role: Programmer
 
Join Date: Mar 2004
Location: Ft. Lauderdale, Florida
Posts: 12
Crazy_Ed has a little shameless behaviour in the past
Send a message via AIM to Crazy_Ed
Re: Anyone with a replacement Printf?

I don't know enough to answer your question, but I would just like to comment that serial ports are way to slow to send anything major across. Maybe next year we get usb or *gasp* ethernet.
__________________
I came, I programmed, I tore my hair out.
  #6   Spotlight this post!  
Unread 19-03-2004, 02:20
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Anyone with a replacement Printf?

Ok, I finally figured out how to modify printf_lib to do what I want. I have posted a white paper + code out my teams web site in the white papers section.

http://www.titanrobotics.net/index2....whitepages.cfm

It is a fully buffered I/O for both the TTY and Program serial ports (i.e. streams).

It is rather nice to be able to have the user interface (to examine the health of the robot) on one port and have the diagnostics spit out on another port simutaneously.

It is also really nice to be able to put printf() in interrupt handlers and have it work without messing up the interrupt handler.

Enjoy.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
printf and newlines Jeff McCune Programming 5 21-02-2004 21:09
Printf warning during compile? actorindp Programming 4 20-02-2004 17:02
printf isn't printf-ing. Help! Meandmyself Programming 14 15-02-2004 16:27
clear printf box? telefragger2000 Programming 6 05-02-2004 17:40
Help! Need replacement Fisher-Price Motor/Gearbox Mr. Van Motors 2 13-02-2003 07:35


All times are GMT -5. The time now is 02:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi