Rev 58 | Rev 60 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 58 | Rev 59 | ||
---|---|---|---|
Line 177... | Line 177... | ||
177 | 177 | ||
178 | /* Configure the system clock */ |
178 | /* Configure the system clock */ |
179 | SystemClock_Config(); |
179 | SystemClock_Config(); |
180 | 180 | ||
181 | /* USER CODE BEGIN SysInit */ |
181 | /* USER CODE BEGIN SysInit */ |
- | 182 | // Switch handler called on sysTick interrupt. |
|
- | 183 | InitSwitches (); |
|
182 | 184 | ||
183 | /* USER CODE END SysInit */ |
185 | /* USER CODE END SysInit */ |
184 | 186 | ||
185 | /* Initialize all configured peripherals */ |
187 | /* Initialize all configured peripherals */ |
186 | MX_GPIO_Init(); |
188 | MX_GPIO_Init(); |
Line 216... | Line 218... | ||
216 | 218 | ||
217 | HAL_TIM_Encoder_Start (&htim3, TIM_CHANNEL_ALL); |
219 | HAL_TIM_Encoder_Start (&htim3, TIM_CHANNEL_ALL); |
218 | 220 | ||
219 | HAL_TIM_Encoder_Start (&htim9, TIM_CHANNEL_ALL); |
221 | HAL_TIM_Encoder_Start (&htim9, TIM_CHANNEL_ALL); |
220 | 222 | ||
221 | // Switch handler called on sysTick interrupt. |
- | |
222 | InitSwitches (); |
- | |
223 | 223 | ||
224 | initModule (&uc3, 9600); |
224 | initModule (&uc3, 9600); |
225 | 225 | ||
226 | // Initialise UART for 4800 baud NMEA |
226 | // Initialise UART for 4800 baud NMEA |
227 | setBaud (&uc2, 4800); |
227 | setBaud (&uc2, 4800); |
Line 411... | Line 411... | ||
411 | 411 | ||
412 | HAL_Delay (1); |
412 | HAL_Delay (1); |
413 | 413 | ||
414 | for (i = 0; i < MAX_DISPLAYS; i++) |
414 | for (i = 0; i < MAX_DISPLAYS; i++) |
415 | { |
415 | { |
416 | if (dial_pos[i] > 1000) |
416 | if (dial_pos[i] < 0) |
417 | dial_pos[i] = PLXItems - 1; |
417 | dial_pos[i] = PLXItems - 1; |
418 | if (dial_pos[i] >= PLXItems) |
418 | if (dial_pos[i] >= PLXItems) |
419 | dial_pos[i] = 0; |
419 | dial_pos[i] = 0; |
420 | 420 | ||
421 | int prevPos = contexts[i].knobPos; |
421 | int prevPos = contexts[i].knobPos; |
Line 451... | Line 451... | ||
451 | __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); |
451 | __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); |
452 | /** Initializes the RCC Oscillators according to the specified parameters |
452 | /** Initializes the RCC Oscillators according to the specified parameters |
453 | * in the RCC_OscInitTypeDef structure. |
453 | * in the RCC_OscInitTypeDef structure. |
454 | */ |
454 | */ |
455 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; |
455 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; |
456 | RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; |
456 | RCC_OscInitStruct.HSEState = RCC_HSE_ON; |
457 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; |
457 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; |
458 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; |
458 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; |
459 | RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12; |
459 | RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12; |
460 | RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3; |
460 | RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3; |
461 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) |
461 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) |