Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Raspberry Pi ACT LED



Hi

The Raspberry Pi has this green ACT LED which is to indicate SD card
activity. It´s connected to GPIO Pin 16 (at least on model B, others
might differ). I wonder how to get this working. My idea is to control
this from bcm2835_emmc.c.


bcm_dmac_transfer(sc->sc_dmac);
LED_ON();
   while (sc->sc_state == EMMC_DMA_STATE_BUSY) {
   error = cv_timedwait(&sc->sc_cv, &sc->sc_lock, hz * 10);
   if (error == EWOULDBLOCK) {
   device_printf(sc->sc.sc_dev, "transfer timeout!\n");
   bcm_dmac_halt(sc->sc_dmac);
   sc->sc_state = EMMC_DMA_STATE_IDLE;
   error = ETIMEDOUT;
   break;
   }
}
LED_OFF();
mutex_exit(&sc->sc_lock);

This also needs to be put in an #ifdef to be only included in a Pi build.

Comments / hints / better ideas?


Home | Main Index | Thread Index | Old Index