FreeCalypso > hg > fc-magnetite
comparison src/cs/drivers/drv_core/inth/niq32.c @ 635:baa0a02bc676
niq32.c DTR handling restored for targets that have it
TI's original TCS211 fw treated GPIO 3 as the DTR input (wired so on C-Sample
and D-Sample boards, also compatible with Leonardo and FCDEV3B which have a
fixed pull-down resistor on this GPIO line), and the code in niq32.c called
UAF_DTRInterruptHandler() (implemented in uartfax.c) from the
IQ_KeypadGPIOHandler() function. But on Openmoko's GTA02 with their official
fw this GPIO is a floating input, all of the DTR handling code in uartfax.c
including the interrupt logic is still there, but the hobbled TCS211-20070608
semi-src delivery which OM got from TI contained a change in niq32.c (which
had been kept in FC until now) that removed the call to
UAF_DTRInterruptHandler() as part of those not-quite-understood "CC test"
hacks.
The present change fixes this bug at a long last: if we are building fw for a
target that has TI's "classic" DTR & DCD GPIO arrangement (dsample, fcmodem and
gtm900), we bring back all of TI's original code in both uartfax.c and niq32.c,
whereas if we are building fw for a target that does not use this classic GPIO
arrangement, the code in niq32.c goes back to what we got from OM and all
DTR & DCD code in uartfax.c is conditioned out. This change also removes the
very last remaining bit of "CC test" bogosity from our FreeCalypso code base.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 19 Jan 2020 01:41:35 +0000 |
parents | 945cf7f506b2 |
children |
comparison
equal
deleted
inserted
replaced
634:6edd9be81b94 | 635:baa0a02bc676 |
---|---|
28 | 28 |
29 #include "chipset.cfg" | 29 #include "chipset.cfg" |
30 #include "board.cfg" | 30 #include "board.cfg" |
31 #include "rf.cfg" | 31 #include "rf.cfg" |
32 #include "swconfig.cfg" | 32 #include "swconfig.cfg" |
33 #include "fc-target.h" | |
33 | 34 |
34 #if(OP_L1_STANDALONE == 0) | 35 #if(OP_L1_STANDALONE == 0) |
35 #include "debug.cfg" | 36 #include "debug.cfg" |
36 #include "rv/rv_defined_swe.h" | 37 #include "rv/rv_defined_swe.h" |
37 #include "rtc/board/rtc_config.h" | 38 #include "rtc/board/rtc_config.h" |
161 SER_uart_handler, /* AIRQ 7 */ | 162 SER_uart_handler, /* AIRQ 7 */ |
162 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) | 163 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11)) |
163 SER_uart_modem_handler, /* AIRQ 7 */ | 164 SER_uart_modem_handler, /* AIRQ 7 */ |
164 #endif | 165 #endif |
165 #if ((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41)) | 166 #if ((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41)) |
166 // CC test 0316 | |
167 IQ_KeypadGPIOHandler, /* AIRQ 8 */ | 167 IQ_KeypadGPIOHandler, /* AIRQ 8 */ |
168 // end | |
169 #else | 168 #else |
170 IQ_KeypadHandler, /* AIRQ 8 */ | 169 IQ_KeypadHandler, /* AIRQ 8 */ |
171 #endif | 170 #endif |
172 IQ_Rtc_Handler, /* AIRQ 9 RTC Timer*/ | 171 IQ_Rtc_Handler, /* AIRQ 9 RTC Timer*/ |
173 #if ((CHIPSET == 2) || (CHIPSET == 3)) | 172 #if ((CHIPSET == 2) || (CHIPSET == 3)) |
537 /*--------------------------------------------------------------*/ | 536 /*--------------------------------------------------------------*/ |
538 /* Parameters : none */ | 537 /* Parameters : none */ |
539 /* Return : none */ | 538 /* Return : none */ |
540 /* Functionality : Handle keypad and GPIO interrupts */ | 539 /* Functionality : Handle keypad and GPIO interrupts */ |
541 /*--------------------------------------------------------------*/ | 540 /*--------------------------------------------------------------*/ |
542 // CC test 0316 | |
543 //#include "rvm/rvm_use_id_list.h" | |
544 //#include "rvf/rvf_api.h" | |
545 //static char debug_buffer[50]; | |
546 // end | |
547 | 541 |
548 void IQ_KeypadGPIOHandler(void) | 542 void IQ_KeypadGPIOHandler(void) |
549 { | 543 { |
550 | 544 |
551 #if (OP_L1_STANDALONE == 0) | 545 #if (OP_L1_STANDALONE == 0) |
552 /* | 546 /* |
553 * GPIO interrupt must be checked before the keypad interrupt. The GPIO | 547 * GPIO interrupt must be checked before the keypad interrupt. The GPIO |
554 * status bit is reset when the register is read. | 548 * status bit is reset when the register is read. |
555 */ | 549 */ |
556 | 550 |
557 if (AI_CheckITSource (ARMIO_GPIO_INT)) | 551 if (AI_CheckITSource (ARMIO_GPIO_INT)) { |
558 | |
559 // CC test 0315 | |
560 { | |
561 AI_MaskIT (ARMIO_MASKIT_GPIO); | |
562 //sprintf(debug_buffer, "GPIO_Interrupt"); | |
563 //rvf_send_trace(debug_buffer, 40, NULL_PARAM, RV_TRACE_LEVEL_ERROR, RVT_USE_ID); | |
564 AI_UnmaskIT(ARMIO_MASKIT_GPIO); //0x0002 | |
565 // end | |
566 /* | |
567 #ifdef RVM_MPM_SWE | 552 #ifdef RVM_MPM_SWE |
568 // check if the SWE has been started | 553 // check if the SWE has been started |
569 MPM_InterruptHandler (); | 554 MPM_InterruptHandler (); |
570 #elif BT_CLK_REQ_INT | 555 #elif BT_CLK_REQ_INT |
571 | |
572 BT_DRV_ClkReqInterruptHandler( ); | 556 BT_DRV_ClkReqInterruptHandler( ); |
557 #elif UARTFAX_CLASSIC_DTR_DCD | |
558 UAF_DTRInterruptHandler (); | |
573 #else | 559 #else |
574 UAF_DTRInterruptHandler (); | 560 AI_MaskIT(ARMIO_MASKIT_GPIO); |
561 AI_UnmaskIT(ARMIO_MASKIT_GPIO); | |
575 #endif | 562 #endif |
576 */ | 563 } |
577 } | |
578 if (AI_CheckITSource (ARMIO_KEYPDAD_INT)) | 564 if (AI_CheckITSource (ARMIO_KEYPDAD_INT)) |
579 { | 565 { |
580 // CC test 0316 | |
581 //sprintf(debug_buffer, "Key_Interrupt"); | |
582 //rvf_send_trace(debug_buffer, 40, NULL_PARAM, RV_TRACE_LEVEL_ERROR, RVT_USE_ID); | |
583 // end | |
584 kpd_key_handler (); | 566 kpd_key_handler (); |
585 } | 567 } |
586 | |
587 #endif | 568 #endif |
588 } | 569 } |
589 | 570 |
590 #elif ((BOARD == 34) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45)) | 571 #elif ((BOARD == 34) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45)) |
591 | 572 |