Merge pull request #666 from gsomlo/gls-sdcard-cd
bios: add command returning card-detect pin status
This commit is contained in:
commit
42025dcbfa
|
@ -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"
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue