Init
This commit is contained in:
parent
a45ac66258
commit
f0d35ae04e
|
|
@ -50,6 +50,7 @@ int32_t CalculateSteps(float Rout_required, int32_t *CountStep100, int32_t *Coun
|
||||||
if (*CountStep100 < 0) *CountStep100 = 0;
|
if (*CountStep100 < 0) *CountStep100 = 0;
|
||||||
|
|
||||||
float R_tail = Rout - (float) (*CountStep100) * Step100;
|
float R_tail = Rout - (float) (*CountStep100) * Step100;
|
||||||
|
|
||||||
if (R_tail < 0) R_tail = 0;
|
if (R_tail < 0) R_tail = 0;
|
||||||
|
|
||||||
*CountStep10 = (int32_t) (R_tail / Step10 + 0.5f);
|
*CountStep10 = (int32_t) (R_tail / Step10 + 0.5f);
|
||||||
|
|
@ -232,11 +233,11 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
||||||
// int32_t div
|
// 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, step100);
|
||||||
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, D100);
|
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, step10);
|
||||||
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, D10);
|
|
||||||
|
|
||||||
|
|
||||||
uint32_t step = 0;
|
uint32_t step = 0;
|
||||||
|
|
||||||
|
|
@ -260,16 +261,16 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// 27
|
||||||
result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, step100);
|
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_1, step100);
|
||||||
asm("nop");
|
asm("nop");
|
||||||
// ++step;
|
// ++step;
|
||||||
|
|
||||||
// if (step> 255)
|
// if (step> 255)
|
||||||
// step =0;
|
// step =0;
|
||||||
|
|
||||||
|
// 19
|
||||||
result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, step10);
|
// result = setSpiSensor(&env->sensorSPI, SENSOR_TYPE_A, SENSOR_ADR_2, step10);
|
||||||
asm("nop");
|
asm("nop");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue