diff options
author | Steve Markgraf <steve@steve-m.de> | 2011-01-11 20:03:35 +0100 |
---|---|---|
committer | Steve Markgraf <steve@steve-m.de> | 2011-01-11 20:03:35 +0100 |
commit | cd918a20aac608c9a0adfa42ed6801b070bbced6 (patch) | |
tree | 8dc5e465cf60a239a130a987671bbd699294dadd /src/target/firmware/apps | |
parent | be9ea273b38167c00ca1e392c60eb794178232d5 (diff) |
target/simtest: remove delay functions
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Diffstat (limited to 'src/target/firmware/apps')
-rwxr-xr-x | src/target/firmware/apps/simtest/main.c | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/src/target/firmware/apps/simtest/main.c b/src/target/firmware/apps/simtest/main.c index 47ea88fa..83f708ef 100755 --- a/src/target/firmware/apps/simtest/main.c +++ b/src/target/firmware/apps/simtest/main.c @@ -1,4 +1,4 @@ -/* main program of Free Software for Calypso Phone */ +/* SIM test application */ /* (C) 2010 by Harald Welte <laforge@gnumonks.org> * @@ -26,6 +26,7 @@ #include <debug.h> #include <memory.h> +#include <delay.h> #include <rffe.h> #include <keypad.h> #include <board.h> @@ -41,10 +42,8 @@ #include <comm/sercomm.h> #include <comm/timer.h> - #include <calypso/sim.h> - #define DEBUG /* Dump bytes in hex on the console */ @@ -128,7 +127,8 @@ uint16_t sim_select(uint16_t fid) txBuffer[1] = (uint8_t) fid; txBuffer[0] = (uint8_t) (fid >> 8); - if(calypso_sim_transceive(SIM_CLASS, SIM_SELECT, 0x00, 0x00, 0x02,txBuffer,status_word, SIM_APDU_PUT) != 0) + if(calypso_sim_transceive(SIM_CLASS, SIM_SELECT, 0x00, 0x00, 0x02, + txBuffer, status_word, SIM_APDU_PUT) != 0) return 0xFFFF; return (status_word[0] << 8) | status_word[1]; @@ -139,7 +139,8 @@ uint16_t sim_status(void) { uint8_t status_word[2]; - if(calypso_sim_transceive(SIM_CLASS, SIM_STATUS, 0x00, 0x00, 0x00,0,status_word, SIM_APDU_PUT) != 0) + if(calypso_sim_transceive(SIM_CLASS, SIM_STATUS, 0x00, 0x00, 0x00, 0, + status_word, SIM_APDU_PUT) != 0) return 0xFFFF; return (status_word[0] << 8) | status_word[1]; @@ -149,33 +150,14 @@ uint16_t sim_status(void) uint16_t sim_readbinary(uint8_t offset_high, uint8_t offset_low, uint8_t length, uint8_t *data) { uint8_t status_word[2]; - if(calypso_sim_transceive(SIM_CLASS, SIM_READ_BINARY, offset_high, offset_low, length, data ,status_word, SIM_APDU_GET) != 0) + if(calypso_sim_transceive(SIM_CLASS, SIM_READ_BINARY, offset_high, + offset_low, length, data ,status_word, + SIM_APDU_GET) != 0) return 0xFFFF; return (status_word[0] << 8) | status_word[1]; } - - - - -/* FIXME: We need properly calibrated delay loops at some point! */ -void delay_us(unsigned int us) -{ - volatile unsigned int i; - - for (i= 0; i < us*4; i++) { i; } -} - -void delay_ms(unsigned int ms) -{ - volatile unsigned int i; - for (i= 0; i < ms*1300; i++) { i; } -} - - - - /* Execute my (dexter's) personal test */ void do_sim_test(void) { @@ -252,9 +234,6 @@ void do_sim_test(void) puts("------------END SIMTEST----8<-----------------\n"); } - - - /* Main Program */ const char *hr = "======================================================================\n"; |