All pastes #546549 Raw Edit

Untitled

public text v1 · immutable
#546549 ·published 2007-06-07 02:46 UTC
rendered paste body
void microsd_int(void)
{
    /* 0x80:inserted, 0x00:not inserted */
    int current_status = ~GPIOA_INPUT_VAL & 0x80;
    
    GPIOA_INT_LEV = (GPIOA_INT_LEV & ~0x80) | (current_status ^ 0x80);
    GPIOA_INT_CLR = GPIOA_INT_STAT & 0x80;
    if (current_status)
    {
        queue_broadcast(SYS_CARD_INSERTED, 0);
    }
    else
    {
        queue_broadcast(SYS_CARD_EXTRACTED, 0);
        sd_status = SD_UNKNOWN;
        card_info[1].initialized = false;
    }
}