Added MBED_16 RTC host test automation (5 reads from RTC)

pull/223/head
Przemek Wirkus 2014-03-20 15:52:06 +00:00
parent a92bf178f6
commit 1e79d929bf
3 changed files with 13 additions and 13 deletions

View File

@ -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);
}
}

View File

@ -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() {

View File

@ -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",