/* Return true if WP pin is configured and is low.  */
static bool card_write_protected(int slot)
/* Return true if WP pin is configured and is low.  */
static bool card_write_protected(int slot)
{
    if (s_slots[slot].gpio_wp == GPIO_UNUSED) {
        return false;
    }
    return gpio_get_level(s_slots[slot].gpio_wp) == 0;
}