diff --git a/.metadata/.plugins/org.eclipse.cdt.core/task1.1727452765701.pdom b/.metadata/.plugins/org.eclipse.cdt.core/task1.1727452765701.pdom index e6dea58..b3202ec 100644 Binary files a/.metadata/.plugins/org.eclipse.cdt.core/task1.1727452765701.pdom and b/.metadata/.plugins/org.eclipse.cdt.core/task1.1727452765701.pdom differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.history/4a/30f39072a21b00111e1997f66d7c19f4 b/.metadata/.plugins/org.eclipse.core.resources/.history/4a/30f39072a21b00111e1997f66d7c19f4 new file mode 100644 index 0000000..3b27bc4 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.history/4a/30f39072a21b00111e1997f66d7c19f4 @@ -0,0 +1,152 @@ +/* *************************************************************************************** + * Project: task1 - C:GPIO + * File: task1.c + * + * Language: C + * + * Hardware: STefi Light v1.1 + * Processor: STM32G431KBT6U + * + * Author: Manuel Lederhofer + * Datum: 10.09.2021 + * + * Version: 2.1 + * History: + * 10.09.2021 ML create project + * 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U + * 18.02.2025 TK changed projectname to "C: GPIO) + * + * Status: under development + * + * Description: + * Blinks the red LED of STefi Light, currently. + * This file contains the main routine and the initialization. + * + * Notes: + * - MCU speed at startup is 16 MHz + * + * Todo: + * - Change the example code to match the description and requirements + * of the requested application in the lab exercise guide. + * + ************************************************************************************** */ + +/* ------------------------------------ INCLUDES -------------------------------------- */ +#include "stm32g431xx.h" +#include "STefi-Light.h" + + +/* ------------------------------------ DEFINES --------------------------------------- */ +#define LOOPS_PER_MS 1244 // NOP-loops for delay() +#define WAITTIME 500 + + +/* ------------------------------------ TYPE DEFINITIONS ------------------------------ */ +/* ------------------------------------ GLOBAL VARIABLES ------------------------------ */ +int state = 0; +/* ------------------------------------ PRIVATE VARIABLES ----------------------------- */ + + +/* ------------------------------------ PROTOTYPES ------------------------------------ */ +static void GPIO_init(void); +static void delay(const uint16_t ms); + + +/* ------------------------------------ M A I N --------------------------------------- */ +int main(void) +{ + /* --- initialization --- */ + __disable_irq(); // disable interrupts globally + + GPIO_init(); + + __enable_irq(); // enable interrupts globally + + + /* --- one time tasks --- */ + + + /* --- infinite processing loop --- */ + while (1) + { + /* ... add your code to implement the lab assignment ... */ + + switch (state) { + case 0: + GPIOA->ODR &= ~(1 << 0); // LED0 on + + state++; + break; + case 1: + delay(WAITTIME); // wait + state++; + break; + case 2: + GPIOA->ODR |= (1 << 0); // LED0 off + delay(WAITTIME); // wait + state = 0; + break; + default: + break; + } + } + + return 1; +} + + +/* ------------------------------------ GLOBAL FUNCTIONS ------------------------------ */ + + +/* ------------------------------------ PRIVATE FUNCTIONS ----------------------------- */ + +/* ------------------------------------------------------------------------------------ *\ + * method: static void GPIO_init(void) + * + * Initializes GPIOs on STefi Light for pins with peripherals attached. + * + * requires: - nothing - + * parameters: - none - + * returns: - nothing - +\* ------------------------------------------------------------------------------------ */ +static void GPIO_init(void) +{ + /* enable port clocks */ + RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // LEDs: A + + + /* --- LEDs --- */ + GPIOA->ODR |= MASK_LED_ALL; + GPIOA->MODER &= ~(3 << 0); + GPIOA->MODER &= ~(3 << 2); + GPIOA->MODER &= ~(3 << 4); + GPIOA->MODER &= ~(3 << 6); + GPIOA->MODER |= (1 << 0); // set LED pin to output + GPIOA->MODER |= (1 << 2); + GPIOA->MODER |= (1 << 4); + GPIOA->MODER |= (1 << 6); +} + + +/* ------------------------------------------------------------------------------------ *\ + * method: static void delay(const uint16_t ms) + * + * Realizes a millisecond delay by very bad busy-wait. + * + * requires: - nothing - + * parameters: ms - delay time in milliseconds + * returns: - nothing - +\* ------------------------------------------------------------------------------------ */ +static void delay(const uint16_t ms) +{ + for (uint16_t i = 0; i < ms; ++i) + { + for (uint16_t j = 0; j < LOOPS_PER_MS; ++j) + { + __asm("NOP"); + } + } +} + + +/* ************************************ E O F ***************************************** */ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task1/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task1/.markers.snap new file mode 100644 index 0000000..6594120 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task1/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task1/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task1/.syncinfo.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task1/.syncinfo.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task2/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task2/.markers.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task2/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task2/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task2/.syncinfo.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task2/.syncinfo.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task3/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task3/.markers.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task3/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task3/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task3/.syncinfo.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task3/.syncinfo.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task4/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task4/.markers.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task4/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/task4/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/task4/.syncinfo.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/task4/.syncinfo.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap new file mode 100644 index 0000000..91d6c54 Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources index b506e1f..7f17616 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/63.snap b/.metadata/.plugins/org.eclipse.core.resources/63.snap new file mode 100644 index 0000000..0be2b7b Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/63.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs index aa9a5d4..10d5fd1 100644 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs @@ -1,10 +1,19 @@ StringVariablePreferencePage=184,154,153,122, eclipse.preferences.version=1 +org.eclipse.debug.ui.MemoryHistoryKnownColor=235,235,235 +org.eclipse.debug.ui.MemoryHistoryUnknownColor=170,175,185 org.eclipse.debug.ui.MemoryView.orientation=0 +org.eclipse.debug.ui.PREF_CHANGED_VALUE_BACKGROUND=150,80,115 org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\n\n +org.eclipse.debug.ui.changedDebugElement=255,128,128 +org.eclipse.debug.ui.consoleBackground=53,53,53 +org.eclipse.debug.ui.errorColor=225,30,70 +org.eclipse.debug.ui.inColor=140,175,210 +org.eclipse.debug.ui.outColor=235,235,235 org.eclipse.debug.ui.save_dirty_editors_before_launch=always org.eclipse.debug.ui.switch_perspective_on_suspend=always org.eclipse.debug.ui.user_view_bindings=\n\n \n \n \n\n +overriddenByCSS=,org.eclipse.debug.ui.MemoryHistoryKnownColor,org.eclipse.debug.ui.MemoryHistoryUnknownColor,org.eclipse.debug.ui.PREF_CHANGED_VALUE_BACKGROUND,org.eclipse.debug.ui.changedDebugElement,org.eclipse.debug.ui.consoleBackground,org.eclipse.debug.ui.errorColor,org.eclipse.debug.ui.inColor,org.eclipse.debug.ui.outColor, pref_state_memento.org.eclipse.debug.ui.BreakpointView=\n\n\n\n\n pref_state_memento.org.eclipse.debug.ui.DebugVieworg.eclipse.debug.ui.DebugView=\r\n pref_state_memento.org.eclipse.debug.ui.ExpressionView=\n\n\n\n\n\n diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs index c5f1f83..79b0632 100644 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs @@ -4,7 +4,7 @@ LaunchTargetManager/org.eclipse.launchbar.core.launchTargetType.local,Local/os=w configDescList=org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task3 Debug,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task3,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task4,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task2,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1 eclipse.preferences.version=1 org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:A3_Timer/activeLaunchMode=run -org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1/activeLaunchMode=debug +org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1/activeLaunchMode=run org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1/activeLaunchTarget=null\:--- org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task2/activeLaunchMode=run org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task2/activeLaunchTarget=null\:--- diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi index 7d141e6..0a1058f 100644 --- a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi +++ b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -1,8 +1,8 @@ - + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration - + @@ -11,9 +11,9 @@ topLevel shellMaximized - - - + + + persp.actionSet:com.st.stm32cube.ide.mcu.informationcenter.actionSet3 persp.actionSet:org.eclipse.ui.cheatsheets.actionSet @@ -67,70 +67,70 @@ persp.viewSC:com.st.stm32cube.ide.mcu.buildanalyzer.view persp.viewSC:com.st.stm32cube.ide.mcu.stackanalyzer.stackanalyzer.view persp.viewSC:com.st.stm32cube.ide.mcu.sfrview - - - + + + View categoryTag:General - + View categoryTag:C/C++ - + View categoryTag:General - - - - - - + + + + + + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + General - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:General - - + + View categoryTag:General - + View categoryTag:General - + View categoryTag:Make @@ -138,7 +138,7 @@ - + persp.actionSet:com.st.stm32cube.ide.mcu.informationcenter.actionSet3 persp.actionSet:org.eclipse.ui.cheatsheets.actionSet @@ -192,121 +192,121 @@ persp.editorOnboardingCommand:Step Over$$$F6 persp.editorOnboardingCommand:Step Return$$$F7 persp.editorOnboardingCommand:Resume$$$F8 - - - + + + org.eclipse.e4.primaryNavigationStack - + View categoryTag:Debug - + View categoryTag:General - - + + View categoryTag:Debug - - - - + + + + org.eclipse.e4.secondaryNavigationStack - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + Debug noFocus - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug @@ -315,2178 +315,2179 @@ - - + + View categoryTag:Help - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:Help - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:Help - - + + org.eclipse.e4.primaryDataStack EditorStack active - noFocus - + Editor removeOnHide org.eclipse.cdt.ui.editor.asm.AsmEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - - + + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor active - activeOnClose - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:C/C++ - + View categoryTag:General - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:Make - + ViewMenu menuContribution:menu - + - + View categoryTag:C/C++ - + ViewMenu menuContribution:menu - + - + View categoryTag:C/C++ - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug activeOnClose - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - - + + toolbarSeparator - + - + Draggable - + - + toolbarSeparator - + - + Draggable - - + + - + toolbarSeparator - + - + Draggable - + Draggable - + Draggable - + Draggable - + toolbarSeparator - + - + Draggable - + - - toolbarSeparator - - - - toolbarSeparator - - - + Draggable - + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + stretch SHOW_RESTORE_MENU - + Draggable HIDEABLE SHOW_RESTORE_MENU - - + + stretch - + Draggable - + Draggable - - + + TrimStack Draggable - + TrimStack Draggable - + TrimStack Draggable - - + + TrimStack Draggable - + TrimStack Draggable - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + platform:gtk - + platform:gtk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - + + - - + + - - - - - - - - - - - + + + + + + + + + + + - - + + - - - - - - + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + type:user - + type:user - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - + + + - - + + - - - - - - + + + + + + - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor removeOnHide - + View categoryTag:Device Configuration Tool - + View categoryTag:C/C++ - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:Debug - + View categoryTag:FreeRTOS - + View categoryTag:FreeRTOS - + View categoryTag:FreeRTOS - + View categoryTag:FreeRTOS - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:C/C++ - + View categoryTag:ThreadX - + View categoryTag:ThreadX - + View categoryTag:ThreadX - + View categoryTag:ThreadX - + View categoryTag:ThreadX - + View categoryTag:ThreadX - + View categoryTag:ThreadX - + View categoryTag:ThreadX - + View categoryTag:C/C++ - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Make - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Help - + View categoryTag:Connections - + View categoryTag:General - + View categoryTag:Version Control (Team) - + View categoryTag:Version Control (Team) - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:C/C++ - + View categoryTag:Debug - + View categoryTag:Other - - + + glue move_after:PerspectiveSpacer SHOW_RESTORE_MENU - + move_after:Spacer Glue HIDEABLE SHOW_RESTORE_MENU - + glue move_after:SearchField SHOW_RESTORE_MENU - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + - - + + - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/task1/Src/task1.c b/task1/Src/task1.c index 3b27bc4..7e3d2e2 100644 --- a/task1/Src/task1.c +++ b/task1/Src/task1.c @@ -74,6 +74,9 @@ int main(void) switch (state) { case 0: GPIOA->ODR &= ~(1 << 0); // LED0 on + GPIOA->ODR &= ~(1 << 1); + GPIOA->ODR &= ~(1 << 2); + GPIOA->ODR &= ~(1 << 3); state++; break; @@ -83,6 +86,9 @@ int main(void) break; case 2: GPIOA->ODR |= (1 << 0); // LED0 off + GPIOA->ODR |= (1 << 1); + GPIOA->ODR |= (1 << 2); + GPIOA->ODR |= (1 << 3); delay(WAITTIME); // wait state = 0; break;