mirror of https://github.com/zrafa/xinu-avr.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
497 B
26 lines
497 B
/* xsh_date.c - xsh_date */ |
|
|
|
#include <xinu.h> |
|
#include <stdio.h> |
|
|
|
/*------------------------------------------------------------------------ |
|
* xsh_date - set or get the date and time |
|
*------------------------------------------------------------------------ |
|
*/ |
|
shellcmd xsh_date(int nargs, char *args[]) |
|
{ |
|
char avr_date[80]; |
|
|
|
if (nargs == 1) { |
|
get_date(avr_date); |
|
printf("\n%s\n\n", avr_date); |
|
return 0; |
|
} |
|
|
|
if (nargs != 3) |
|
return -1; |
|
|
|
set_date(args[1], args[2]); |
|
|
|
return 0; |
|
}
|
|
|