# HG changeset patch # User Paul Boddie # Date 1360604901 0 # Node ID 36c36cd4406705976ad08d793364bd588b7713a7 # Parent 34c97017a4e2319914c2bc509008460a82556ce9 Removed nanosleep and usleep delays. diff -r 34c97017a4e2 -r 36c36cd44067 test.c --- a/test.c Mon Feb 11 17:45:48 2013 +0000 +++ b/test.c Mon Feb 11 17:48:21 2013 +0000 @@ -15,8 +15,6 @@ #include #include -#include -#include #include #include @@ -104,32 +102,14 @@ #define max_reg_read(n) (max_reg(n) | MAX_REG_READ) #define max_reg_write(n) (max_reg(n) | MAX_REG_WRITE) -#define nanosleep(a, b) if (0) -#define usleep(a) if (0) - -struct timespec tCSS = {0, 20}, - tL = {0, 30}, - tCSW = {0, 200}, - tCL = {0, 17}, - tCH = {0, 17}, - tDS = {0, 5}, - tDH = {0, 10}, - tDO = {0, 15}, - tDI = {0, 15}, - tON = {0, 4}, - tRESET = {0, 200}, - tTEST = {0, 100}; - void spi_begin() { CLR(MAX_SS); - nanosleep(&tL, NULL); /* tCSS is the minimum, but tL is more conservative */ } void spi_end() { SET(MAX_SS); - nanosleep(&tCSW, NULL); } /** @@ -161,16 +141,12 @@ /* Wait for stable output signal. */ - nanosleep(&tDS, NULL); - SET(MAX_SCLK); if (PIN(MAX_MISO)) result |= mask; - nanosleep(&tCH, NULL); CLR(MAX_SCLK); - nanosleep(&tCL, NULL); } #ifdef DEBUG @@ -236,7 +212,6 @@ while ((timeout > 0) && (!check())) { - usleep(3000); /* 3ms */ timeout--; }