示例#1
0
static inline uint8_t bldc_sense() {
    uint8_t state;
    state  = GET(BEMF_APORT, BEMF_APIN) << 2;
    state |= GET(BEMF_BPORT, BEMF_BPIN) << 1;
    state |= GET(BEMF_CPORT, BEMF_CPIN);
    return statemap(state);
}
示例#2
0
文件: main.c 项目: canthar/BLDC-ESC
static inline uint8_t bldc_sense() {
    uint8_t state;
    state  = GET(BEMF_UPORT, BEMF_U) << 2;
    state |= GET(BEMF_VPORT, BEMF_V) << 1;
    state |= GET(BEMF_WPORT, BEMF_W);
    return statemap(state);
}