first cut at turnon scripts for EasyTimer v2
[fw/altos] / src / drivers / ao_74hc165.c
index f24fce37a58faab977f0c6bf0e273f264103103f..b62e0134ce671e79b3b7c0ea214830834787c4d9 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
 uint8_t
 ao_74hc165_read(void)
 {
-       static __xdata state;
-       ao_mutex_get(&ao_spi_mutex);
-       ao_spi_set_speed(AO_SPI_SPEED_FAST);
+       static state;
+       ao_spi_get(AO_74HC165_SPI_BUS);
+       ao_spi_set_speed(AO_74HC165_SPI_BUS, AO_SPI_SPEED_FAST);
        AO_74HC165_CS = 1;
        ao_spi_recv(&state, 1, AO_74HC165_SPI_BUS);
        AO_74HC165_CS = 0;
-       ao_mutex_put(&ao_spi_mutex);
+       ao_spi_put(AO_74HC165_SPI_BUS);
        return state;
 }