diff --git a/chip/basic/basic_h/marco.h b/chip/basic/basic_h/marco.h index 5da9d0f..9084402 100644 --- a/chip/basic/basic_h/marco.h +++ b/chip/basic/basic_h/marco.h @@ -1,6 +1,6 @@ #pragma once #ifndef ZARRAY_SIZE -#define ZARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#define ZARRAY_SIZE(x) ((int32_t)(sizeof(x) / sizeof(x[0]))) #endif #define ZMAX(a, b) ((a) > (b) ? (a) : (b)) #define ZMIN(a, b) ((a) < (b) ? (a) : (b)) diff --git a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp index 3de2073..552e6d6 100644 --- a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp +++ b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp @@ -258,7 +258,7 @@ int32_t StepMotorCtrlModule::rotate(int32_t speed, int32_t lastforms, action_cb_ bool reachtime = false; while (!m_thread.getExitFlag()) { - if (zos_haspassedms(startticket) > lastforms && lastforms != 0) { + if ((int32_t)zos_haspassedms(startticket) > lastforms && lastforms != 0) { reachtime = true; m_stepM1->stop(); break;