Запущена симуляция переструктурированного проекта

This commit is contained in:
2025-03-26 12:28:15 +03:00
parent 7b6cc2fa50
commit 0d80b52d9b
7 changed files with 23 additions and 23 deletions

View File

@@ -31,7 +31,7 @@ void GPIO_to_SFUNC(real_T* out_buff)
out_buff[PORT_WIDTH + i] = 1;
}
if (GPIOE->ODR & (1 << i))
if (GPIOA->ODR & (1 << i))
{
out_buff[2*PORT_WIDTH + i] = 1;
}
@@ -50,12 +50,12 @@ void SFUNC_to_GPIO(real_T* in)
{
int i = 0;
// write pwm ctrl registers
for (i = 0; i < 5; i++)
for (i = 0; i < 6; i++)
{
pwm_ctrl[i] = in[i];
}
// write pwm ctrl coils
if (in[5] > 0.5)
if (in[i++] > 0.5)
{
MB_Set_Coil_Local(coils_regs, COIL_PWM_DC_MODE);
}
@@ -63,7 +63,7 @@ void SFUNC_to_GPIO(real_T* in)
{
MB_Reset_Coil_Local(coils_regs, COIL_PWM_DC_MODE);
}
if (in[6] > 0.5)
if (in[i++] > 0.5)
{
MB_Set_Coil_Local(coils_regs, COIL_PWM_BRIDGE_MODE);
}
@@ -71,7 +71,7 @@ void SFUNC_to_GPIO(real_T* in)
{
MB_Reset_Coil_Local(coils_regs, COIL_PWM_BRIDGE_MODE);
}
if (in[7] > 0.5)
if (in[i++] > 0.5)
{
MB_Set_Coil_Local(coils_regs, COIL_PWM_PHASE_MODE);
}

View File

@@ -25,11 +25,11 @@
//#define AHB_Prescaler ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos)
//#define AHB_Prescaler ((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)
#define HCLK_Value (double)72000000;
#define ABP1_Value (double)72000000;
#define ABP1_TIMS_Value (double)72000000;
#define ABP2_Value (double)72000000;
#define ABP2_TIMS_Value (double)72000000;
#define HCLK_Value (double)168000000;
#define ABP1_Value (double)42000000;
#define ABP1_TIMS_Value (double)84000000;
#define ABP2_Value (double)42000000;
#define ABP2_TIMS_Value (double)84000000;
/* Эти дефайны добавлены в код stm32f4xx_hal_rcc.c, чтобы не попасть в бесконечный цикл */
/* Мб перенести в MCU_Periph_Simulation(), но чет не хочется нагружать симуляцию этой херней */