As I did just that, I also "fixed" the MMC driver to stop the Power LED from blinking every time the SD card was accessed.
The way I did that was to use the following config.h:
#define SD_CS_POWER 0x82And the modify the spi.c to have:
static inline void mmc_spi_cs_high(void) {Also, as I am now using GPIOs #2,3,5,7, I had to add a line
port_state |= SD_CS_POWER;
(...)
echo "0xac" > /proc/diag/gpiomaskin one of the init scripts.
For /etc/hotplug.d/button/01-radio-toggle, I am currently using the following, but I might change that to just turn the radio on/off:
if [ "$BUTTON" = "ses" ] ; then
if [ "$ACTION" = "pressed" ] ; then
WIFI_RADIOSTATUS=$(wlc radio)
# touch /tmp/$WIFI_RADIOSTATUS
case "$WIFI_RADIOSTATUS" in
0|"")
uci set wireless.wl0.disabled=0
uci commit wireless
wifi
wlc radio 1
echo f > /proc/diag/led/wlan
;;
1)
uci set wireless.wl0.disabled=1
uci commit wireless
wifi
wlc radio 0
echo 0 > /proc/diag/led/wlan
;;
esac
fi
fi
Despite the non-quite-thought-through use of the GPIOs in the default MMC driver, I'm beginning to think openWRT is the best invention since sliced bread!
No comments:
Post a Comment
Note: only a member of this blog may post a comment.