47 #define outChar esos_PutUint8ToCommOut
58 #if (NUM_UART_MODS >= 1)
63 #if (NUM_UART_MODS >= 2)
68 #if (NUM_UART_MODS >= 3)
73 #if (NUM_UART_MODS >= 4)
91 #if (SERIAL_EOL_DEFAULT==SERIAL_EOL_CR_LF)
92 if (*psz_s ==
'\n')
outChar(0x0D);
95 #if (SERIAL_EOL_DEFAULT==SERIAL_EOL_CR)
96 if (*psz_s ==
'\n')
outChar(0x0D);
99 #if (SERIAL_EOL_DEFAULT==SERIAL_EOL_LF)
114 if (!u16_maxCount)
return 0;
116 for (u16_i = 0; u16_i < u16_maxCount; u16_i++) {
119 if (u8_c ==
'\n' ||u8_c ==
'\r' )
break;
139 return inStringInternal(psz_buff,u16_maxCount,0);
146 return inStringInternal(psz_buff,u16_maxCount,1);
150 void outUint8NoLeader(
uint8_t u8_x) {
152 u8_c = (u8_x>>4)& 0xf;
153 if (u8_c > 9)
outChar(
'A'+u8_c-10);
157 if (u8_c > 9)
outChar(
'A'+u8_c-10);
167 outUint8NoLeader(u8_x);
179 outUint8NoLeader(u8_c);
181 outUint8NoLeader(u8_c);
191 u8_c = (u32_x >> 24);
192 outUint8NoLeader(u8_c);
193 u8_c = (u32_x >> 16);
194 outUint8NoLeader(u8_c);
196 outUint8NoLeader(u8_c);
198 outUint8NoLeader(u8_c);
206 static const uint8_t u8_d[]= {50, 30, 20, 10, 5, 3, 2, 1 };
207 static const uint8_t u8_f[]= {5, 3, 2, 1, 5, 3, 2, 1 };
218 if (u8_destroy >= 200) {
222 if (u8_destroy >= 100) {
226 for (u8_i=0; u8_i<8; u8_i++) {
227 if (u8_destroy >= u8_d[u8_i]) {
228 psz_out[1+(u8_i/4)] += u8_f[u8_i];
229 u8_destroy -= u8_d[u8_i];
241 static const uint16_t u16_d[]= {50000, 30000, 20000, 10000, 5000, 3000, 2000, 1000, \
242 500, 300, 200, 100, 50, 30, 20, 10, 5, 3, 2, 1
244 static const uint8_t u8_f[]= {5, 3, 2, 1 };
258 for (u8_i=0; u8_i<20; u8_i++) {
259 if (u16_destroy >= u16_d[u8_i]) {
260 psz_out[u8_i/4] += u8_f[u8_i % 4];
261 u16_destroy -= u16_d[u8_i];
276 switch (__C30_UART) {
277 #if (NUM_UART_MODS >= 1)
281 #if (NUM_UART_MODS >= 2)
285 #if (NUM_UART_MODS >= 3)
289 #if (NUM_UART_MODS >= 4)
315 switch (__C30_UART) {
316 #if (NUM_UART_MODS >= 1)
320 #if (NUM_UART_MODS >= 2)
322 return isCharReady2();
324 #if (NUM_UART_MODS >= 3)
326 return isCharReady3();
328 #if (NUM_UART_MODS >= 4)
330 return isCharReady4();
347 #if (NUM_UART_MODS >= 1)
353 #if (NUM_UART_MODS >= 2)
356 configUART2(u32_baudRate);
359 #if (NUM_UART_MODS >= 3)
362 configUART3(u32_baudRate);
365 #if (NUM_UART_MODS >= 4)
368 configUART4(u32_baudRate);