sti clock

This commit is contained in:
yichin
2019-06-03 12:48:23 +08:00
parent c27b6a0ac7
commit 0df352d6ff
@@ -66,6 +66,7 @@ TODO
#include "headstage_debug.h"
#include "headstage_power.h"
#include "headstage_clock.h"
#include "headstage_pin.h"
#include "headstage_notify.h"
#include "sti/headstage_gptimer.h"
@@ -388,6 +389,16 @@ static void headstage_sti_stepping_callback(NeuLiveStiChannelState *s);
=======================*/
static void headstage_sti_event() {
if (flag_mask(EVT_PERIODIC_CLOCK)) {
flag_disable(EVT_PERIODIC_CLOCK);
// XXX
}
if (EVENT_MASK == 0) {
// fast return
return;
}
if (flag_mask(EVT_STI_TERM)) {
flag_disable(EVT_STI_TERM);
headstage_sti_gptimer_term();
@@ -415,6 +426,9 @@ static void headstage_init() {
// init PWM
headstage_pwm_open();
// init clock
headstage_clock_open(1000);
// init gpio
headstage_pin_output(PIN_POL0, 0);
headstage_pin_output(PIN_POL1, 0);