mirror of https://github.com/ARMmbed/mbed-os.git
Added MBED_16 RTC host test automation (5 reads from RTC)
parent
a92bf178f6
commit
1e79d929bf
|
@ -1,19 +1,14 @@
|
|||
#include "mbed.h"
|
||||
|
||||
int main() {
|
||||
set_time(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37
|
||||
#define CUSTOM_TIME 1256729737
|
||||
|
||||
int main() {
|
||||
char buffer[32] = {0};
|
||||
set_time(CUSTOM_TIME); // Set RTC time to Wed, 28 Oct 2009 11:35:37
|
||||
while(1) {
|
||||
time_t seconds = time(NULL);
|
||||
|
||||
printf("Time as seconds since January 1, 1970 = %d\n", seconds);
|
||||
|
||||
printf("Time as a basic string = %s", ctime(&seconds));
|
||||
|
||||
char buffer[32];
|
||||
strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds));
|
||||
printf("Time as a custom formatted string = %s", buffer);
|
||||
|
||||
strftime(buffer, 32, "%Y-%m-%d %H:%M:%S %p", localtime(&seconds));
|
||||
printf("[%d] [%s]\n", seconds, buffer);
|
||||
wait(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,12 +6,14 @@ Timeout to1;
|
|||
Timeout to2;
|
||||
|
||||
void led1_on() {
|
||||
led1 = 1;
|
||||
led1 = !led1;
|
||||
printf("led1\n\r");
|
||||
fflush(stdout);
|
||||
}
|
||||
void led2_on() {
|
||||
led2 = 1;
|
||||
led2 = !led2;
|
||||
printf("led2\n\r");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
|
|
@ -350,6 +350,9 @@ TESTS = [
|
|||
"id": "MBED_16", "description": "RTC",
|
||||
"source_dir": join(TEST_DIR, "mbed", "rtc"),
|
||||
"dependencies": [MBED_LIBRARIES],
|
||||
"automated": True,
|
||||
"host_test": "rtc_auto",
|
||||
"duration": 15
|
||||
},
|
||||
{
|
||||
"id": "MBED_17", "description": "Serial Interrupt 2",
|
||||
|
|
Loading…
Reference in New Issue