add button test at the board startup, part 4
This commit is contained in:
		
							parent
							
								
									1eb0c2c318
								
							
						
					
					
						commit
						77f8faba9e
					
				@ -112,10 +112,13 @@ void button_init_and_test(void)
 | 
				
			|||||||
				display_write_data_byte('-');
 | 
									display_write_data_byte('-');
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} while (pressed_elements != 0x1 && pressed_elements != 0x3E);
 | 
						} while (!(((pressed_elements & 0x1) == 0x1) || ((pressed_elements & 0x3E) == 0x3E)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// visual reaction to bar fill
 | 
						// visual reaction to bar fill
 | 
				
			||||||
 | 
						DISPLAY_SET_CURSOR(0, 0);
 | 
				
			||||||
 | 
						display_write_data_seq("Release buttons");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GPIOD->ODR = 0x1000;
 | 
						GPIOD->ODR = 0x1000;
 | 
				
			||||||
	HAL_Delay(500);
 | 
						HAL_Delay(500);
 | 
				
			||||||
	GPIOD->ODR = 0x2000;
 | 
						GPIOD->ODR = 0x2000;
 | 
				
			||||||
@ -124,10 +127,10 @@ void button_init_and_test(void)
 | 
				
			|||||||
	HAL_Delay(500);
 | 
						HAL_Delay(500);
 | 
				
			||||||
	GPIOD->ODR = 0x8000;
 | 
						GPIOD->ODR = 0x8000;
 | 
				
			||||||
	HAL_Delay(500);
 | 
						HAL_Delay(500);
 | 
				
			||||||
	GPIOD->ODR = 0x0000;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// waiting for control buttons to be released
 | 
						// waiting for control buttons to be released
 | 
				
			||||||
	while (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0) | !HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_8));
 | 
						while (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0) | !HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_8));
 | 
				
			||||||
 | 
						GPIOD->ODR = 0x0000;
 | 
				
			||||||
	HAL_Delay(500);
 | 
						HAL_Delay(500);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// switch mode for user button
 | 
						// switch mode for user button
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user