summaryrefslogtreecommitdiff
path: root/usb-device-ccid-project
diff options
context:
space:
mode:
Diffstat (limited to 'usb-device-ccid-project')
-rw-r--r--usb-device-ccid-project/main.c29
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]);
personal git repositories of Harald Welte. Your mileage may vary