annotate target-utils/loadagent/mygetchar.c @ 853:ae254ffeaec3

AT command interface works! The cause of the breakage was the same Nucleus API issue with NU_Create_Timer() which we encountered at the very beginning of this project with Riviera timers: the code in uartfax.c from TCS211 was passing 0 as the initial dummy value for the timer duration, and our FreeNucleus version doesn't like it. The fix is the same: pass 1 as the initial dummy value instead.
author Space Falcon <falcon@ivan.Harhan.ORG>
date Thu, 30 Apr 2015 01:46:26 +0000
parents c0e063494194
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * The interactive command entry (editing) function in libcommon
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * will call mygetchar() for its character input. It is supposed
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 * to be a blocking wait for input, but in some programs other
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 * processing can be done while waiting - for example, check for
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 * keypad presses as well. This is the basic version which waits
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 * for serial input and nothing else.
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 */
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 extern int serial_in_poll();
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 int
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 mygetchar()
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 {
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 register int c;
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 do
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 c = serial_in_poll();
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 while (c < 0);
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 return c;
c0e063494194 loadagent built with memory dump commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 }