This is the first working version of the new logging system. Some work
in fine tuning still needs to be done. But is reasonably OK now.
This commit is contained in:
11
oscillate.c
11
oscillate.c
@ -15,7 +15,6 @@
|
||||
#include "fortify.h"
|
||||
#include "sics.h"
|
||||
#include "task.h"
|
||||
#include "commandlog.h"
|
||||
#include "oscillate.h"
|
||||
|
||||
#define ABS(x) (x < 0 ? -(x) : (x))
|
||||
@ -31,7 +30,7 @@ static void StopOscillation(pOscillator self)
|
||||
}
|
||||
MotorSetPar(self->pMot, self->pCon, "accesscode", usUser);
|
||||
if (self->debug > 0) {
|
||||
WriteToCommandLog("oscillator>> ", "Stopping");
|
||||
Log(INFO,"com","%s","oscillator stopping");
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,16 +78,16 @@ static int OscillationTask(void *data)
|
||||
switch (status) {
|
||||
case HWFault:
|
||||
case HWPosFault:
|
||||
WriteToCommandLog("oscillator>> ",
|
||||
Log(ERROR,"com","%s:%s","oscillator:",
|
||||
"ERROR occurred in oscillation, try running motor manually to find out more");
|
||||
WriteToCommandLog("oscillator>> ",
|
||||
Log(INFO,"com","%s:%s","oscillator",
|
||||
"Trying to run other direction");
|
||||
pos = getNextPos(self);
|
||||
status = MotorRun(self->pMot, self->pCon, pos);
|
||||
if (self->debug > 0) {
|
||||
snprintf(message, 131, "Started oscillation to %f, ret code = %d",
|
||||
pos, status);
|
||||
WriteToCommandLog("oscillator>>", message);
|
||||
Log(INFO,"com","%s:%s","oscillator", message);
|
||||
}
|
||||
break;
|
||||
case HWWarn:
|
||||
@ -109,7 +108,7 @@ static int OscillationTask(void *data)
|
||||
if (self->debug > 0) {
|
||||
snprintf(message, 131, "Started oscillation to %f, ret code = %d",
|
||||
pos, status);
|
||||
WriteToCommandLog("oscillator>>", message);
|
||||
Log(INFO,"com","%s:%s","oscillator", message);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user