Exemplo n.º 1
0
static bool handleStep(int size, const byte *msg, CONTEXT *context)
    {
    byte bind = msg[1];
    byte *expr = (byte *) &msg[2];
    byte stepperId = evalWord8Expr(&expr, context);
    int16_t steps = evalInt16Expr(&expr, context);

    steppers[stepperId]->step(steps);
    if (context->currBlockLevel <= 0)
        {
        sendReply(0, STEP_RESP_STEP, NULL, context, bind);
        }
    return false;
    }
Exemplo n.º 2
0
void storeInt16Ref(byte *expr, CONTEXT *context, byte refIndex)
    {
    int16_t i16Val = evalInt16Expr(&expr, context);

    *((int16_t *) haskinoRefs[refIndex].ref) = i16Val;
    }