Finish lab1
HAS NOT BEEN SUBMITTED YET
This commit is contained in:
parent
a28b001f58
commit
2ef12470b7
8 changed files with 8204 additions and 8661 deletions
|
@ -103,14 +103,33 @@ int main(void)
|
|||
MX_SPI1_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
//Default Red(pin14) and Blue(pin15) to on
|
||||
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_14,GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_15,GPIO_PIN_SET);
|
||||
|
||||
//Default green(pin12) and orange(pin13) to off
|
||||
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_12,GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_13,GPIO_PIN_RESET);
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1)
|
||||
{
|
||||
//Toggle every wait loop
|
||||
HAL_GPIO_TogglePin(GPIOD,GPIO_PIN_12);
|
||||
HAL_GPIO_TogglePin(GPIOD,GPIO_PIN_14);
|
||||
|
||||
//Wait
|
||||
for(int i=0; i< 300000; i++);
|
||||
|
||||
//Init pushbutton state
|
||||
GPIO_PinState Push_Button = HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0);
|
||||
|
||||
//Set LEDs depending on pushbutton state
|
||||
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_13,Push_Button);
|
||||
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_15,!Push_Button);
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
|||
../Core/Src/main.c:75:5:main 16 static
|
||||
../Core/Src/main.c:125:6:SystemClock_Config 112 static
|
||||
../Core/Src/main.c:177:13:MX_I2C1_Init 8 static
|
||||
../Core/Src/main.c:211:13:MX_I2S2_Init 8 static
|
||||
../Core/Src/main.c:245:13:MX_I2S3_Init 8 static
|
||||
../Core/Src/main.c:279:13:MX_SPI1_Init 8 static
|
||||
../Core/Src/main.c:317:13:MX_GPIO_Init 56 static
|
||||
../Core/Src/main.c:410:6:Error_Handler 4 static
|
||||
../Core/Src/main.c:144:6:SystemClock_Config 112 static
|
||||
../Core/Src/main.c:196:13:MX_I2C1_Init 8 static
|
||||
../Core/Src/main.c:230:13:MX_I2S2_Init 8 static
|
||||
../Core/Src/main.c:264:13:MX_I2S3_Init 8 static
|
||||
../Core/Src/main.c:298:13:MX_SPI1_Init 8 static
|
||||
../Core/Src/main.c:336:13:MX_GPIO_Init 56 static
|
||||
../Core/Src/main.c:429:6:Error_Handler 4 static
|
||||
|
|
BIN
lab1/Debug/firmware.bin
Executable file
BIN
lab1/Debug/firmware.bin
Executable file
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
4
terminalCommands.txt
Normal file
4
terminalCommands.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Once main is complete, run the following in the Debug folder
|
||||
main -j$(nproc) all
|
||||
arm-none-eabi-objcopy -O binary [projectname].elf firmware.bin
|
||||
st-flash write firmware.bin 0x8000000
|
Loading…
Add table
Reference in a new issue