From f0d35ae04ee80107b83f14f8cb516d874253d4fb Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 7 Apr 2026 14:55:07 +0300 Subject: [PATCH] Init --- MainModesArbiter.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/MainModesArbiter.c b/MainModesArbiter.c index fb97f20..3c69969 100644 --- a/MainModesArbiter.c +++ b/MainModesArbiter.c @@ -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");