summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2009-01-11 18:13:58 +0000
committerAntoine Cellerier <dionoea@videolan.org>2009-01-11 18:13:58 +0000
commitfd02bb2d28b2d0d85509b652911080b73cd8baa2 (patch)
treeba964f663e037db994bfdca8e95901d493d46229
parent7d7969114da36a99afc4d80576ff9b089cb09e50 (diff)
downloadrockbox-fd02bb2d28b2d0d85509b652911080b73cd8baa2.tar.gz
rockbox-fd02bb2d28b2d0d85509b652911080b73cd8baa2.zip
Remove tabs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19749 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/serial.c182
1 files changed, 91 insertions, 91 deletions
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c
index a789f880fc..f66221b561 100644
--- a/firmware/drivers/serial.c
+++ b/firmware/drivers/serial.c
@@ -80,7 +80,7 @@ int tx_rdy(void)
80int rx_rdy(void) 80int rx_rdy(void)
81{ 81{
82 if(SSR1 & SCI_RDRF) 82 if(SSR1 & SCI_RDRF)
83 return 1; 83 return 1;
84 else 84 else
85 return 0; 85 return 0;
86} 86}
@@ -121,7 +121,7 @@ int remote_control_rx(void)
121 } 121 }
122 122
123 if(rx_rdy()) { 123 if(rx_rdy()) {
124 btn = rx_readc(); 124 btn = rx_readc();
125 125
126 if(last_was_error) 126 if(last_was_error)
127 { 127 {
@@ -197,7 +197,7 @@ int tx_rdy(void)
197 if(USR0 & 0x04) 197 if(USR0 & 0x04)
198 return 1; 198 return 1;
199 else 199 else
200 return 0; 200 return 0;
201} 201}
202 202
203int rx_rdy(void) 203int rx_rdy(void)
@@ -294,10 +294,10 @@ void serial_bitrate(int rate)
294{ 294{
295 if(rate == 0) 295 if(rate == 0)
296 { 296 {
297 autobaud = 2; 297 autobaud = 2;
298 SER0_LCR = 0x80; /* Divisor latch enable */ 298 SER0_LCR = 0x80; /* Divisor latch enable */
299 SER0_DLL = 0x0D; /* 24000000/13/16 = 115384 baud */ 299 SER0_DLL = 0x0D; /* 24000000/13/16 = 115384 baud */
300 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 300 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
301 return; 301 return;
302 } 302 }
303 303
@@ -341,90 +341,90 @@ void SERIAL0(void)
341 341
342 while(rx_rdy()) 342 while(rx_rdy())
343 { 343 {
344 temp = rx_readc(); 344 temp = rx_readc();
345 if (newpkt && autobaud > 0) 345 if (newpkt && autobaud > 0)
346 { 346 {
347 if (autobaud == 1) 347 if (autobaud == 1)
348 { 348 {
349 switch (temp) 349 switch (temp)
350 { 350 {
351 case 0xFF: 351 case 0xFF:
352 case 0x55: 352 case 0x55:
353 break; 353 break;
354 case 0xFC: 354 case 0xFC:
355 SER0_LCR = 0x80; /* Divisor latch enable */ 355 SER0_LCR = 0x80; /* Divisor latch enable */
356 SER0_DLL = 0x4E; /* 24000000/78/16 = 19230 baud */ 356 SER0_DLL = 0x4E; /* 24000000/78/16 = 19230 baud */
357 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 357 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
358 temp = 0xFF; 358 temp = 0xFF;
359 break; 359 break;
360 case 0xE0: 360 case 0xE0:
361 SER0_LCR = 0x80; /* Divisor latch enable */ 361 SER0_LCR = 0x80; /* Divisor latch enable */
362 SER0_DLL = 0x9C; /* 24000000/156/16 = 9615 baud */ 362 SER0_DLL = 0x9C; /* 24000000/156/16 = 9615 baud */
363 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 363 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
364 temp = 0xFF; 364 temp = 0xFF;
365 break; 365 break;
366 default: 366 default:
367 badbaud++; 367 badbaud++;
368 if (badbaud >= 6) /* Switch baud detection mode */ 368 if (badbaud >= 6) /* Switch baud detection mode */
369 { 369 {
370 autobaud = 2; 370 autobaud = 2;
371 SER0_LCR = 0x80; /* Divisor latch enable */ 371 SER0_LCR = 0x80; /* Divisor latch enable */
372 SER0_DLL = 0x0D; /* 24000000/13/16 = 115384 baud */ 372 SER0_DLL = 0x0D; /* 24000000/13/16 = 115384 baud */
373 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 373 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
374 badbaud = 0; 374 badbaud = 0;
375 } else { 375 } else {
376 SER0_LCR = 0x80; /* Divisor latch enable */ 376 SER0_LCR = 0x80; /* Divisor latch enable */
377 SER0_DLL = 0x1A; /* 24000000/26/16 = 57692 baud */ 377 SER0_DLL = 0x1A; /* 24000000/26/16 = 57692 baud */
378 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 378 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
379 } 379 }
380 continue; 380 continue;
381 } 381 }
382 } else { 382 } else {
383 switch (temp) 383 switch (temp)
384 { 384 {
385 case 0xFF: 385 case 0xFF:
386 case 0x55: 386 case 0x55:
387 break; 387 break;
388 case 0xFE: 388 case 0xFE:
389 SER0_LCR = 0x80; /* Divisor latch enable */ 389 SER0_LCR = 0x80; /* Divisor latch enable */
390 SER0_DLL = 0x1A; /* 24000000/26/16 = 57692 baud */ 390 SER0_DLL = 0x1A; /* 24000000/26/16 = 57692 baud */
391 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 391 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
392 temp = 0xFF; 392 temp = 0xFF;
393 break; 393 break;
394 case 0xFC: 394 case 0xFC:
395 SER0_LCR = 0x80; /* Divisor latch enable */ 395 SER0_LCR = 0x80; /* Divisor latch enable */
396 SER0_DLL = 0x27; /* 24000000/39/16 = 38461 baud */ 396 SER0_DLL = 0x27; /* 24000000/39/16 = 38461 baud */
397 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 397 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
398 temp = 0xFF; 398 temp = 0xFF;
399 break; 399 break;
400 case 0xE0: 400 case 0xE0:
401 SER0_LCR = 0x80; /* Divisor latch enable */ 401 SER0_LCR = 0x80; /* Divisor latch enable */
402 SER0_DLL = 0x4E; /* 24000000/78/16 = 19230 baud */ 402 SER0_DLL = 0x4E; /* 24000000/78/16 = 19230 baud */
403 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 403 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
404 temp = 0xFF; 404 temp = 0xFF;
405 break; 405 break;
406 default: 406 default:
407 badbaud++; 407 badbaud++;
408 if (badbaud >= 6) /* Switch baud detection */ 408 if (badbaud >= 6) /* Switch baud detection */
409 { 409 {
410 autobaud = 1; 410 autobaud = 1;
411 SER0_LCR = 0x80; /* Divisor latch enable */ 411 SER0_LCR = 0x80; /* Divisor latch enable */
412 SER0_DLL = 0x1A; /* 24000000/26/16 = 57692 baud */ 412 SER0_DLL = 0x1A; /* 24000000/26/16 = 57692 baud */
413 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 413 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
414 badbaud = 0; 414 badbaud = 0;
415 } else { 415 } else {
416 SER0_LCR = 0x80; /* Divisor latch enable */ 416 SER0_LCR = 0x80; /* Divisor latch enable */
417 SER0_DLL = 0x0D; /* 24000000/13/16 = 115384 baud */ 417 SER0_DLL = 0x0D; /* 24000000/13/16 = 115384 baud */
418 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */ 418 SER0_LCR = 0x03; /* Divisor latch disable, 8-N-1 */
419 } 419 }
420 continue; 420 continue;
421 } 421 }
422 } 422 }
423 } 423 }
424 bool pkt = iap_getc(temp); 424 bool pkt = iap_getc(temp);
425 if(newpkt == true && pkt == false) 425 if(newpkt == true && pkt == false)
426 autobaud = 0; /* Found good baud */ 426 autobaud = 0; /* Found good baud */
427 newpkt = pkt; 427 newpkt = pkt;
428 } 428 }
429} 429}
430 430