/* TODO -----> Step #4 */ if(pin == GPIO_PIN_RB2) { /* level high thru the Pull up -> there is no SD card in the slot */ if(GPIO_RB2_Get()) { appSDcardData.isThereSDcard = false; // -- Optional /* If the application was running */ if((appSDcardData.state != APP_SDCARD_STATE_IDLE) && (appSDcardData.state != APP_SDCARD_STATE_ERROR)) { SYS_DEBUG_MESSAGE(SYS_ERROR_DEBUG, "SD card ejected while operating -> data might be corrupted or lost"); appSDcardData.state = APP_SDCARD_STATE_ERROR; } } /* level low -> there is a SD card in the slot */ else { appSDcardData.isThereSDcard = true; } }