|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: printf() inside interrupt routine?
Quote:
-Kevin |
|
#2
|
||||
|
||||
|
Re: printf() inside interrupt routine?
I thought that's what printf did?
|
|
#3
|
|||||
|
|||||
|
Re: printf() inside interrupt routine?
Printf converts the data you pass to it into a human-readable string format. For instance, the value 100 would be converted into the following three characters: '1' '0' '0'. What Kevin is suggesting is for you to simply send the byte values themselves out of the serial port. This can be done very quickly and won't impact the ISR very much. You can then read those values into the computer and view them at your leisure, or record them and process them with an additional application (which may be quite useful for what it seems you're trying to do).
|
|
#4
|
||||
|
||||
|
Re: printf() inside interrupt routine?
As Adam pointed out, and assuming you're using my serial port driver, it's as simple as this:
Code:
// first, find out how much data, if any, is present in
// serial port 1's received data queue?
byte_count = Serial_Port_One_Byte_Count();
// have we received any data?
if(byte_count > 0)
{
// we have fresh data, so read each received byte one at a time
for(j = 0; j < byte_count; j++)
{
// get the next data byte
data = Read_Serial_Port_One();
// send it out the other serial port
Write_Serial_Port_Two(data);
// work with camera data here
}
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Routine declaration syntax error (Or: Where's wlado?) | Astronouth7303 | Programming | 15 | 24-03-2004 05:51 |
| printf isn't printf-ing. Help! | Meandmyself | Programming | 14 | 15-02-2004 16:27 |
| Pre-Match/Post- Match Pit Routine | Mark_lyons | General Forum | 14 | 31-03-2002 15:19 |
| Master uP Initialization Routine | Ulibrium | Technical Discussion | 5 | 24-01-2002 16:43 |