diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-07-30 23:19:06 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-07-30 23:19:06 +0200 |
commit | 63d587cf2ef26b5737f9293d03c86ffd183d5a04 (patch) | |
tree | f3dc69e293737e253877705e3bfc08272827bd53 /usb-device-ccid-project | |
parent | 3e504477a9227b984e2cc8e63913b4d228068040 (diff) |
ccid main: fix PIO configuration and PIO interrupt
Diffstat (limited to 'usb-device-ccid-project')
-rw-r--r-- | usb-device-ccid-project/main.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/usb-device-ccid-project/main.c b/usb-device-ccid-project/main.c index ab1874a..3f25f58 100644 --- a/usb-device-ccid-project/main.c +++ b/usb-device-ccid-project/main.c @@ -142,9 +142,9 @@ static const Pin pinsISO7816[] = {PINS_ISO7816}; static const Pin pinIso7816RstMC = PIN_ISO7816_RSTMC;
static const Pin pinsPower[] = {
- /* low = off */
+ /* Swlf Power (LDO): low = off */
{1 << 5, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT},
- /* high = off */
+ /* Phone pass-through power: high = off */
{1 << 26, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT},
};
@@ -162,23 +162,14 @@ static const Pin pinSmartCard = PIN_SMARTCARD_CONNECT; //------------------------------------------------------------------------------
static void ISR_PioSmartCard(const Pin *pPin)
{
- printf("-H- ISR_PioSmartCard\n\r");
- // Check all pending interrupts
- if ((pinSmartCard.pio->PIO_ISR & pinSmartCard.mask) != 0) {
- printf("-H- SmartCard.mask\n\r");
-
- // Check current level on pin
- if (PIO_Get(&pinSmartCard) == 0) {
-
+ // Check current level on pin
+ if (PIO_Get(&pinSmartCard) == 0) {
printf("-H- Insert\n\r");
- CCID_Insertion();
- }
- else {
-
+ CCID_Insertion();
+ } else {
printf("-H- Removal\n\r");
- CCID_Removal();
- }
- }
+ CCID_Removal();
+ }
}
//------------------------------------------------------------------------------
@@ -539,8 +530,8 @@ int main( void ) ConfigureCardDetection();
// Configure ISO7816 driver
- PIO_Configure(pinsISO7816, PIO_LISTSIZE(&pinsISO7816));
- PIO_Configure(pinsPower, PIO_LISTSIZE(&pinsPower));
+ PIO_Configure(pinsISO7816, PIO_LISTSIZE(pinsISO7816));
+ PIO_Configure(pinsPower, PIO_LISTSIZE(pinsPower));
/* power up the card */
PIO_Set(&pinsPower[0]);
|