Added the "KEvent" console command. #17
1 changed files with 7 additions and 5 deletions
|
|
@ -29,12 +29,14 @@
|
|||
#include "esp_log.h"
|
||||
#include "SystemK.h"
|
||||
|
||||
uint32_t parse_uint32(const char *str, bool *ok) {
|
||||
static uint32_t parse_uint32(const char *str, bool *ok)
|
||||
{
|
||||
char *end;
|
||||
errno = 0;
|
||||
unsigned long val = strtoul(str, &end, 10);
|
||||
|
||||
if (errno != 0 || end == str || *end != '\0' || val > UINT32_MAX) {
|
||||
if (errno != 0 || end == str || *end != '\0' || val > UINT32_MAX)
|
||||
{
|
||||
*ok = false;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -48,7 +50,7 @@ static void print_usage(void)
|
|||
printf(
|
||||
"Usage:\n"
|
||||
" KEvent <Event ID> <Event Data>\n"
|
||||
" (Note that IDs may be SystemK version-dependant.)\n");
|
||||
" (Note that IDs may be SystemK version-dependent.)\n");
|
||||
}
|
||||
|
||||
static int cmd_KEvent(int argc, char **argv)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue