Merge pull request #666 from gsomlo/gls-sdcard-cd

bios: add command returning card-detect pin status
This commit is contained in:
enjoy-digital 2020-10-06 10:31:25 +02:00 committed by GitHub
commit 42025dcbfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,22 @@
#include "../command.h" #include "../command.h"
#include "../helpers.h" #include "../helpers.h"
/**
* Command "sdcard_detect"
*
* Detect SDcard
*
*/
#ifdef CSR_SDPHY_BASE
static void sdcard_detect_handler(int nb_params, char **params)
{
uint8_t cd = sdphy_card_detect_read();
printf("SDCard %sinserted.\n", cd ? "not " : "");
}
define_command(sdcard_detect, sdcard_detect_handler, "Detect SDCard", LITESDCARD_CMDS);
#endif
/** /**
* Command "sdcard_init" * Command "sdcard_init"
* *