Skip to content

Commit

Permalink
Merge pull request #478 from Paciente8159/fix-74hc595-concurrency
Browse files Browse the repository at this point in the history
fixed 74HC595 concurrency issues
  • Loading branch information
Paciente8159 committed Aug 18, 2023
2 parents d72f7fa + 29c36bf commit 180e224
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion uCNC/src/core/interpolator.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ MCU_CALLBACK void mcu_step_cb(void)
// loads a new segment
itp_rt_sgm = &itp_sgm_data[itp_sgm_data_read];
cnc_set_exec_state(EXEC_RUN);
if (itp_rt_sgm->remaining_steps)
if (itp_rt_sgm->block != NULL)
{
#if (DSS_MAX_OVERSAMPLING != 0)
if (itp_rt_sgm->next_dss != 0)
Expand Down
8 changes: 3 additions & 5 deletions uCNC/src/hal/mcus/esp32/mcu_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ uint8_t mcu_softpwm_freq_config(uint16_t freq)

void mcu_core0_tasks_init(void *arg)
{
#ifdef IC74HC595_HAS_PWMS
// register PWM isr
timer_isr_register(PWM_TIMER_TG, PWM_TIMER_IDX, mcu_pwm_isr, NULL, 0, NULL);
#endif
#ifdef MCU_HAS_UART
// install UART driver handler
uart_driver_install(COM_PORT, RX_BUFFER_CAPACITY * 2, 0, 0, NULL, 0);
Expand Down Expand Up @@ -399,6 +395,8 @@ void mcu_init(void)
timer_set_counter_value(PWM_TIMER_TG, PWM_TIMER_IDX, 0x00000000ULL);
/* Configure the alarm value and the interrupt on alarm. */
timer_set_alarm_value(PWM_TIMER_TG, PWM_TIMER_IDX, (uint64_t)157);
// register PWM isr
timer_isr_register(PWM_TIMER_TG, PWM_TIMER_IDX, mcu_pwm_isr, NULL, 0, NULL);
timer_enable_intr(PWM_TIMER_TG, PWM_TIMER_IDX);
#endif

Expand Down Expand Up @@ -468,7 +466,7 @@ void mcu_init(void)
i2s_set_pin(IC74HC595_I2S_PORT, &pin_config);

I2SREG.clkm_conf.clka_en = 0; // Use PLL/2 as reference
I2SREG.clkm_conf.clkm_div_num = 4; // reset value of 4
I2SREG.clkm_conf.clkm_div_num = 2; // reset value of 4
I2SREG.clkm_conf.clkm_div_a = 1; // 0 at reset, what about divide by 0?
I2SREG.clkm_conf.clkm_div_b = 0; // 0 at reset

Expand Down

0 comments on commit 180e224

Please sign in to comment.