X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fapps%2Fsmartcard%2Fsmartcard.c;h=566081bb5eb173ad617bf19415de9b32c0132be6;hp=d8b85391c4022952e20daeda136e160693bb5abb;hb=69539bb167246135b1bde3c55dca7d19bc3c7aee;hpb=8c1f892f78632617a581869ad1483f7444769c2d diff --git a/firmware/apps/smartcard/smartcard.c b/firmware/apps/smartcard/smartcard.c index d8b8539..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; - P1OUT^=1; + led_toggle(); if(SCIN!=foo){ foo=SCIN; }