Filter: use millis/micros/panic functions

This commit is contained in:
Caio Marcelo de Oliveira Filho 2015-11-20 12:15:30 +09:00 committed by Randy Mackay
parent 578b31e7f8
commit 51a6455ac0
1 changed files with 2 additions and 2 deletions

View File

@ -22,10 +22,10 @@ static float noise(void)
void loop() void loop()
{ {
hal.scheduler->delay(50); hal.scheduler->delay(50);
float t = hal.scheduler->millis()*1.0e-3f; float t = AP_HAL::millis()*1.0e-3f;
float s = sinf(t); float s = sinf(t);
//s += noise(); //s += noise();
uint32_t t1 = hal.scheduler->micros(); uint32_t t1 = AP_HAL::micros();
derivative.update(s, t1); derivative.update(s, t1);
float output = derivative.slope() * 1.0e6f; float output = derivative.slope() * 1.0e6f;
hal.console->printf("%f %f %f %f\n", t, output, s, cosf(t)); hal.console->printf("%f %f %f %f\n", t, output, s, cosf(t));