X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Fapps%2Fsmartcard%2Fsmartcard.c;h=93beb3a73bdb74a0bd3db68ab6e3564ef1e602c5;hb=443bcd972725a80fd8d55014d4f1d84485ec53f0;hp=0d8de50d8194128f8fa0192ad11dffe1db382f25;hpb=602c5212c0b08f5056f639749e0246b4855a4921;p=goodfet diff --git a/firmware/apps/smartcard/smartcard.c b/firmware/apps/smartcard/smartcard.c index 0d8de50..93beb3a 100644 --- a/firmware/apps/smartcard/smartcard.c +++ b/firmware/apps/smartcard/smartcard.c @@ -8,6 +8,30 @@ #include "platform.h" #include "command.h" #include "jtag.h" +#include "smartcard.h" + +//! Handles a monitor command. +void smartcard_handle_fn( uint8_t const app, + uint8_t const verb, + uint32_t const len); + +// define the smartcard app's app_t +app_t const smartcard_app = { + + /* app number */ + SMARTCARD, + + /* handle fn */ + smartcard_handle_fn, + + /* name */ + "SMARTCARD", + + /* desc */ + "\tThe SMARTCARD app allows for communication with smart\n" + "\tcards and SIM cards.\n" +}; + //TDO/P5.2 is Data @@ -35,9 +59,10 @@ void smartcardsetup(){ u16 sctime=0, foo=0; //! Handles a monitor command. -int smartcardhandle(unsigned char app, - unsigned char verb, - unsigned int len){ +void smartcard_handle_fn( uint8_t const app, + uint8_t const verb, + uint32_t const len) +{ switch(verb){ case SETUP: smartcardsetup(); @@ -61,7 +86,7 @@ int smartcardhandle(unsigned char app, delay(5); SCTOCK; - P1OUT^=1; + PLEDOUT^=PLEDPIN; if(SCIN!=foo){ foo=SCIN; } @@ -74,5 +99,4 @@ int smartcardhandle(unsigned char app, debugstr("Unknown smartcard verb."); txdata(app,NOK,0); } - return 0; }