summaryrefslogtreecommitdiff
path: root/openpicc/application/da.c
diff options
context:
space:
mode:
Diffstat (limited to 'openpicc/application/da.c')
-rw-r--r--openpicc/application/da.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openpicc/application/da.c b/openpicc/application/da.c
index 64cee5b..e645053 100644
--- a/openpicc/application/da.c
+++ b/openpicc/application/da.c
@@ -26,6 +26,7 @@
#include <lib_AT91SAM7.h>
static const AT91PS_SPI spi = AT91C_BASE_SPI;
+static u_int8_t last_value;
void da_comp_carr(u_int8_t position)
{
@@ -43,6 +44,12 @@ void da_comp_carr(u_int8_t position)
while (!(spi->SPI_SR & AT91C_SPI_TDRE)) { }
for (i = 0; i < 0xff; i++) { }
AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SS2_DT_THRESH);
+ last_value = position;
+}
+
+u_int8_t da_get_value(void)
+{
+ return last_value;
}
void da_init(void)
personal git repositories of Harald Welte. Your mileage may vary