1.1 --- a/test.c Mon Feb 11 17:45:48 2013 +0000
1.2 +++ b/test.c Mon Feb 11 17:48:21 2013 +0000
1.3 @@ -15,8 +15,6 @@
1.4
1.5 #include <ubb/ubb.h>
1.6 #include <stdio.h>
1.7 -#include <time.h>
1.8 -#include <unistd.h>
1.9 #include <signal.h>
1.10 #include <stdlib.h>
1.11
1.12 @@ -104,32 +102,14 @@
1.13 #define max_reg_read(n) (max_reg(n) | MAX_REG_READ)
1.14 #define max_reg_write(n) (max_reg(n) | MAX_REG_WRITE)
1.15
1.16 -#define nanosleep(a, b) if (0)
1.17 -#define usleep(a) if (0)
1.18 -
1.19 -struct timespec tCSS = {0, 20},
1.20 - tL = {0, 30},
1.21 - tCSW = {0, 200},
1.22 - tCL = {0, 17},
1.23 - tCH = {0, 17},
1.24 - tDS = {0, 5},
1.25 - tDH = {0, 10},
1.26 - tDO = {0, 15},
1.27 - tDI = {0, 15},
1.28 - tON = {0, 4},
1.29 - tRESET = {0, 200},
1.30 - tTEST = {0, 100};
1.31 -
1.32 void spi_begin()
1.33 {
1.34 CLR(MAX_SS);
1.35 - nanosleep(&tL, NULL); /* tCSS is the minimum, but tL is more conservative */
1.36 }
1.37
1.38 void spi_end()
1.39 {
1.40 SET(MAX_SS);
1.41 - nanosleep(&tCSW, NULL);
1.42 }
1.43
1.44 /**
1.45 @@ -161,16 +141,12 @@
1.46
1.47 /* Wait for stable output signal. */
1.48
1.49 - nanosleep(&tDS, NULL);
1.50 -
1.51 SET(MAX_SCLK);
1.52
1.53 if (PIN(MAX_MISO))
1.54 result |= mask;
1.55
1.56 - nanosleep(&tCH, NULL);
1.57 CLR(MAX_SCLK);
1.58 - nanosleep(&tCL, NULL);
1.59 }
1.60
1.61 #ifdef DEBUG
1.62 @@ -236,7 +212,6 @@
1.63
1.64 while ((timeout > 0) && (!check()))
1.65 {
1.66 - usleep(3000); /* 3ms */
1.67 timeout--;
1.68 }
1.69