1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 10:52:44 +01:00

python expect hwtimer test included

This commit is contained in:
Stephan Zeisberg 2010-10-26 17:06:07 +02:00
parent c80ab019c4
commit f6e76b8f24
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,5 @@
SubDir TOP projects test_hwtimer ;
Module test_hwtimer : main.c : hwtimer ;
UseModule test_hwtimer ;

View File

@ -0,0 +1,29 @@
#include <stdio.h>
#include <hwtimer.h>
#include <kernel.h>
#include <board.h>
void callback(void* ptr) {
puts((char*)ptr);
}
extern uint32_t hwtimer_now();
int main(void)
{
puts("hwtimer test project.");
puts("Initializing hwtimer...");
hwtimer_init();
puts("Initializing hwtimer [OK].");
// while (TA0R < 20000);
hwtimer_set(20000LU, callback, (void*)"callback1");
hwtimer_set(50000LU, callback, (void*)"callback2");
hwtimer_set(30000LU, callback, (void*)"callback3");
puts("hwtimer set.");
}

View File

@ -0,0 +1,17 @@
#!/usr/bin/python
import pexpect
import os
import subprocess
child = pexpect.spawn ("board/msba2/tools/bin/pseudoterm %s" % os.environ["PORT"])
null = open('/dev/null', 'wb')
subprocess.call(['jam', 'reset'], stdout=null)
child.expect ('OK\r\n');
child.expect ('callback1\r\n');
child.expect ('callback3\r\n');
child.expect ('callback2\r\n');
print("Test successful!")