small changes 2

develop
Katya 1 year ago
parent 8086a52104
commit 9f371543b3

@ -38,7 +38,6 @@
/* Private variables ---------------------------------------------------------*/
SPI_HandleTypeDef hspi1;
TIM_HandleTypeDef htim1;
TIM_HandleTypeDef htim2;
@ -67,7 +66,6 @@ static void MX_SPI1_Init(void);
int main(void)
{
/* USER CODE BEGIN 1 */
// прописать нули в л12 л11
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
GPIOA->MODER &= ~(3U << (0 * 2));
GPIOA->MODER &= ~(3U << (3 * 2));
@ -107,9 +105,7 @@ int main(void)
uint8_t recData[10] = {0};
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_SET);
//volatile uint32_t start_ticks = DWT->CYCCNT;
if (HAL_SPI_Receive(&hspi1, recData, 10, HAL_MAX_DELAY) == HAL_OK) {
//volatile uint32_t end_ticks= DWT->CYCCNT;
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_RESET);
}
//----------------КАНАЛ 1---------------
@ -141,10 +137,8 @@ int main(void)
modes[1].pwm_value_res = (modes[1].pwm_value * modes[1].freq_pwm_new) / MAX_PWM_FREQ; // пересчет скважности для 2 канала
HAL_TIM_Base_Start_IT(&htim1);
while (1)
{
while (1) {
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
if (channel == 1 && settings_set == 0) {
settings_set = 1; // канал 1 настроен

@ -212,7 +212,6 @@ void TIM1_UP_TIM10_IRQHandler(void)
CommonChannelActions(&modes[0], 1, &channel, &iter, &settings_set);
}
//HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_1);
/* USER CODE END TIM1_UP_TIM10_IRQn 0 */
HAL_TIM_IRQHandler(&htim1);
/* USER CODE BEGIN TIM1_UP_TIM10_IRQn 1 */
@ -224,7 +223,6 @@ void TIM1_UP_TIM10_IRQHandler(void)
void CommonChannelActions(Mode *mode_ptr, int channel, int *channelPtr, int *iter, int *settings_set) {
ChannelSwap(mode_ptr, channel, channelPtr, (channel == 1) ? 1 : 0, settings_set);
SetInvert(mode_ptr);
//SetIN_R1(mode_ptr);
if (channel == 1) *iter = 1;
}
/* USER CODE END 1 */

Loading…
Cancel
Save