This commit is contained in:
cfif 2026-04-07 14:55:07 +03:00
parent a45ac66258
commit f0d35ae04e
1 changed files with 9 additions and 8 deletions

View File

@ -50,6 +50,7 @@ int32_t CalculateSteps(float Rout_required, int32_t *CountStep100, int32_t *Coun
if (*CountStep100 < 0) *CountStep100 = 0;
float R_tail = Rout - (float) (*CountStep100) * Step100;
if (R_tail < 0) R_tail = 0;
*CountStep10 = (int32_t) (R_tail / Step10 + 0.5f);
@ -232,11 +233,11 @@ static _Noreturn void Mma_Thread(tMma *env) {
// int32_t div
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, 255-27);
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, 255-19);
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, D100);
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, D10);
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, step100);
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, step10);
uint32_t step = 0;
@ -260,16 +261,16 @@ static _Noreturn void Mma_Thread(tMma *env) {
*/
result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, step100);
// 27
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, step100);
asm("nop");
// ++step;
// if (step> 255)
// step =0;
result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, step10);
// 19
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, step10);
asm("nop");