Skip to content
Snippets Groups Projects
Commit f6e76b8f authored by Stephan Zeisberg's avatar Stephan Zeisberg
Browse files

python expect hwtimer test included

parent c80ab019
No related branches found
No related tags found
No related merge requests found
SubDir TOP projects test_hwtimer ;
Module test_hwtimer : main.c : hwtimer ;
UseModule test_hwtimer ;
#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.");
}
#!/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!")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment