X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Fapps%2Fsmartcard%2Fsmartcard.c;h=566081bb5eb173ad617bf19415de9b32c0132be6;hb=064d6b06568f16badffdf04e515824172c6bca68;hp=db32de2928c33b5a6ece463d2418cce4518271c3;hpb=0351243d52f70e34790269e600c65413ddb4bc7c;p=goodfet diff --git a/firmware/apps/smartcard/smartcard.c b/firmware/apps/smartcard/smartcard.c index db32de2..566081b 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; - PLEDOUT^=PLEDPIN; + led_toggle(); if(SCIN!=foo){ foo=SCIN; } @@ -74,5 +99,4 @@ int smartcardhandle(unsigned char app, debugstr("Unknown smartcard verb."); txdata(app,NOK,0); } - return 0; }