diff --git a/access_control_python/__pycache__/face_processing.cpython-311.pyc b/access_control_python/__pycache__/face_processing.cpython-311.pyc
new file mode 100644
index 0000000..5d69bbe
Binary files /dev/null and b/access_control_python/__pycache__/face_processing.cpython-311.pyc differ
diff --git a/access_control_python/camera_test.py b/access_control_python/camera_test.py
index 28b0da3..e97557e 100644
--- a/access_control_python/camera_test.py
+++ b/access_control_python/camera_test.py
@@ -3,23 +3,26 @@ import cv2
import base64
import requests
-#Capture Image
-cam = cv2.VideoCapture(1)
-ret, img = cam.read()
+# #Capture Image
+# cam = cv2.VideoCapture(1)
+# ret, img = cam.read()
# #Save Image
# cv2.imwrite("cam_test_img_pre.jpg",img)
-# #Load Image
-# img = cv2.imread("cam_test_img_pre.jpg")
+#Load Image
+img = cv2.imread("cam_test_img_pre.jpg")
#Encode Image
ret, jpg_buffer = cv2.imencode('.jpg',img)
b64_img = base64.b64encode(jpg_buffer)
#Send Image to Server
+api_endpoint = "https://racist.siwatsystem.com/process_image"
+api_endpoint = "http://localhost:5000/identify_face"
+
data = {"image":b64_img.decode("utf-8")}
-req = requests.post("https://racist.siwatsystem.com/process_image",json=data)
+req = requests.post(api_endpoint,json=data)
print(req.content)
#Decode Image
diff --git a/access_control_python/face_processing.py b/access_control_python/face_processing.py
new file mode 100644
index 0000000..df66e5a
--- /dev/null
+++ b/access_control_python/face_processing.py
@@ -0,0 +1,28 @@
+import numpy as np
+import cv2
+import base64
+import requests
+import json
+
+api_server = "http://localhost:5000"
+#api_server = "https://racist.siwatsystem.com"
+
+def analyze_face(img):
+ endpoint = api_server +"/process_image"
+ ret, jpg_buffer = cv2.imencode('.jpg',img)
+ b64_img = base64.b64encode(jpg_buffer)
+ data = {"image":b64_img.decode("utf-8")}
+ req = requests.post(endpoint,json=data)
+ res = res.content.decode("utf-8")
+ res = json.loads(res)
+ return res
+
+def identify_face(img, target_condidence: float):
+ endpoint = api_server +"/identify_face"
+ ret, jpg_buffer = cv2.imencode('.jpg',img)
+ b64_img = base64.b64encode(jpg_buffer)
+ data = {"image":b64_img.decode("utf-8"),"target_confidence": target_condidence}
+ req = requests.post(endpoint,json=data)
+ res = req.content.decode("utf-8")
+ res = json.loads(res)
+ return res
\ No newline at end of file
diff --git a/access_control_python/identify_test.py b/access_control_python/identify_test.py
new file mode 100644
index 0000000..09a7ffc
--- /dev/null
+++ b/access_control_python/identify_test.py
@@ -0,0 +1,8 @@
+import numpy as np
+import cv2
+import face_processing as fp
+cam = cv2.VideoCapture(0)
+while True:
+ #Capture Image
+ ret, img = cam.read()
+ print(fp.identify_face(img,0.4))
diff --git a/access_control_python/main.py b/access_control_python/main.py
index 973b8fe..15f9f76 100644
--- a/access_control_python/main.py
+++ b/access_control_python/main.py
@@ -1,21 +1,37 @@
+import cv2
+import threading
+import time
+import face_processing as fp
from access_control import access_control
-from line_notify import LineNotify
-import time
-stm32 = access_control("COM12")
-time.sleep(1)
-stm32.lock_door()
-#stm32.unlock_door()
-time.sleep(1)
-#door_state = False
-#while True:
- #print(stm32._in_payloads)
- #if(door_state != stm32.get_door_state()):
- # door_state = stm32.get_door_state()
- # notify = LineNotify("olK1QXriiuKgfxB6xkj7SIFfj9jsXfpl2PqmjCDuBRw")
- # notify.send(f'door is {door_state}')
- #if(stm32.get_door_state() == True):
- # stm32.lock_door()
- #else:
- # stm32.unlock_door()
- #time.sleep(0.01)
+SERIAL_PORT = "COM12"
+CAMERA_INDEX = 0
+
+cam = cv2.VideoCapture(CAMERA_INDEX)
+stm32 = access_control(SERIAL_PORT)
+
+global img
+global frame_ready
+frame_ready = False
+
+def read_webcam():
+ global img
+ global frame_ready
+ while True:
+ ret, img = cam.read()
+ frame_ready = True
+
+threading.Thread(target=read_webcam).start()
+
+while True:
+ while not frame_ready:
+ time.sleep(1)
+
+ #Try to identify face
+ faces = fp.identify_face(img, target_condidence=0.4)
+ if(len(faces)>0):
+ print("Door Unlocked!, Locking in 5 seconds")
+ stm32.unlock_door()
+ time.sleep(5)
+ stm32.lock_door()
+ print("Door Locked!")
diff --git a/access_control_python/mcu_test.py b/access_control_python/mcu_test.py
new file mode 100644
index 0000000..dbd13e9
--- /dev/null
+++ b/access_control_python/mcu_test.py
@@ -0,0 +1,26 @@
+from access_control import access_control
+from line_notify import LineNotify
+import time
+
+stm32 = access_control("COM12")
+time.sleep(1)
+while True:
+ cmd = input("Enter Command : ")
+ if(cmd == 'lock'):
+ stm32.lock_door()
+ if(cmd == 'unlock'):
+ stm32.unlock_door()
+#stm32.unlock_door()
+time.sleep(1)
+#door_state = False
+#while True:
+ #print(stm32._in_payloads)
+ #if(door_state != stm32.get_door_state()):
+ # door_state = stm32.get_door_state()
+ # notify = LineNotify("olK1QXriiuKgfxB6xkj7SIFfj9jsXfpl2PqmjCDuBRw")
+ # notify.send(f'door is {door_state}')
+ #if(stm32.get_door_state() == True):
+ # stm32.lock_door()
+ #else:
+ # stm32.unlock_door()
+ #time.sleep(0.01)
diff --git a/access_control_python_server/app.py b/access_control_python_server/app.py
index 3cb77de..31718ac 100644
--- a/access_control_python_server/app.py
+++ b/access_control_python_server/app.py
@@ -4,17 +4,29 @@ import cv2
import base64
import numpy as np
from deepface import DeepFace
+import face_recognition as face
+import os
app = Flask(__name__)
+face_encodings: list = []
+face_names: list = []
+
+def init_face() -> None:
+ for file in os.scandir("faces"):
+ face_name = file.name.split('.')
+ face_name = '.'.join(face_name[0:len(face_name)-1])
+ face_names.append(face_name)
+ face_image = face.load_image_file(file.path)
+ face_encodings.append(face.face_encodings(face_image)[0])
@app.route('/')
-def home():
+def home() -> str:
return '
Ching Chong Bing Bong Ding Dong!!
'
@app.route('/process_image', methods=['POST'])
-def process_image():
+def process_image() -> str:
print(request.data)
request_data = json.loads(request.data.decode("utf-8"))
img_nparr = np.frombuffer(base64.b64decode(request_data['image']), np.uint8)
@@ -25,6 +37,30 @@ def process_image():
except:
return []
+@app.route('/identify_face', methods=['POST'])
+def identify_face() -> str:
+ request_data = json.loads(request.data.decode("utf-8"))
+ target_confidence: float = request_data['target_confidence']
+ img_nparr = np.frombuffer(base64.b64decode(request_data['image']), np.uint8)
+ img = cv2.imdecode(img_nparr,cv2.IMREAD_COLOR)
+ img = cv2.resize(img, (0,0), fx=0.5,fy=0.5)
+ img = np.ascontiguousarray(img[:, :, ::-1])
+ face_locations = face.face_locations(img)
+ face_encodings_img = face.face_encodings(img, face_locations)
+ response: list = []
+ for face_encoding in face_encodings_img:
+ face_distances = face.face_distance(face_encodings, face_encoding)
+ index = np.argmin(face_distances)
+ confidence = 1-face_distances[index]
+ if confidence >= target_confidence:
+ response.append({'name':face_names[index],'confidence': confidence})
+ return response
+
+
if __name__ == '__main__':
+ init_face()
+ print(face_names)
+ print(face_encodings)
+
app.run()
diff --git a/access_control_python_server/faces/boom.jpg b/access_control_python_server/faces/boom.jpg
new file mode 100644
index 0000000..7cd0d28
Binary files /dev/null and b/access_control_python_server/faces/boom.jpg differ
diff --git a/access_control_python_server/faces/skt.jpg b/access_control_python_server/faces/skt.jpg
new file mode 100644
index 0000000..3ff6221
Binary files /dev/null and b/access_control_python_server/faces/skt.jpg differ
diff --git a/access_control_python_server/requirements.txt b/access_control_python_server/requirements.txt
index 1aa999e..4120b4f 100644
--- a/access_control_python_server/requirements.txt
+++ b/access_control_python_server/requirements.txt
@@ -1,3 +1,4 @@
flask
opencv-python
-deepface
\ No newline at end of file
+deepface
+face_recognition
\ No newline at end of file
diff --git a/access_control_stm32/.settings/language.settings.xml b/access_control_stm32/.settings/language.settings.xml
index beef393..20511cb 100644
--- a/access_control_stm32/.settings/language.settings.xml
+++ b/access_control_stm32/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/access_control_stm32/Core/Src/main.c b/access_control_stm32/Core/Src/main.c
index 9ea9cfb..dc0a673 100644
--- a/access_control_stm32/Core/Src/main.c
+++ b/access_control_stm32/Core/Src/main.c
@@ -59,18 +59,12 @@ UART_HandleTypeDef huart2;
/* Definitions for mainTask */
osThreadId_t mainTaskHandle;
-const osThreadAttr_t mainTask_attributes = {
- .name = "mainTask",
- .stack_size = 128 * 4,
- .priority = (osPriority_t) osPriorityNormal,
-};
+const osThreadAttr_t mainTask_attributes = { .name = "mainTask", .stack_size =
+ 128 * 4, .priority = (osPriority_t) osPriorityNormal, };
/* Definitions for doorHandler */
osThreadId_t doorHandlerHandle;
-const osThreadAttr_t doorHandler_attributes = {
- .name = "doorHandler",
- .stack_size = 128 * 4,
- .priority = (osPriority_t) osPriorityLow,
-};
+const osThreadAttr_t doorHandler_attributes = { .name = "doorHandler",
+ .stack_size = 128 * 4, .priority = (osPriority_t) osPriorityLow, };
/* USER CODE BEGIN PV */
uint8_t uart_buffer[10];
uint8_t uart_index = 0;
@@ -101,207 +95,201 @@ void startDoorHandleTask(void *argument);
/* USER CODE END 0 */
/**
- * @brief The application entry point.
- * @retval int
- */
-int main(void)
-{
- /* USER CODE BEGIN 1 */
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void) {
+ /* USER CODE BEGIN 1 */
- /* USER CODE END 1 */
+ /* USER CODE END 1 */
- /* MCU Configuration--------------------------------------------------------*/
+ /* MCU Configuration--------------------------------------------------------*/
- /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
- HAL_Init();
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
- /* USER CODE BEGIN Init */
+ /* USER CODE BEGIN Init */
- /* USER CODE END Init */
+ /* USER CODE END Init */
- /* Configure the system clock */
- SystemClock_Config();
+ /* Configure the system clock */
+ SystemClock_Config();
- /* USER CODE BEGIN SysInit */
+ /* USER CODE BEGIN SysInit */
- /* USER CODE END SysInit */
+ /* USER CODE END SysInit */
- /* Initialize all configured peripherals */
- MX_GPIO_Init();
- MX_USART2_UART_Init();
- /* USER CODE BEGIN 2 */
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_USART2_UART_Init();
+ /* USER CODE BEGIN 2 */
memset(uart_buffer, 0, 10);
- /* USER CODE END 2 */
+ /* USER CODE END 2 */
- /* Init scheduler */
- osKernelInitialize();
+ /* Init scheduler */
+ osKernelInitialize();
- /* USER CODE BEGIN RTOS_MUTEX */
+ /* USER CODE BEGIN RTOS_MUTEX */
/* add mutexes, ... */
- /* USER CODE END RTOS_MUTEX */
+ /* USER CODE END RTOS_MUTEX */
- /* USER CODE BEGIN RTOS_SEMAPHORES */
+ /* USER CODE BEGIN RTOS_SEMAPHORES */
/* add semaphores, ... */
- /* USER CODE END RTOS_SEMAPHORES */
+ /* USER CODE END RTOS_SEMAPHORES */
- /* USER CODE BEGIN RTOS_TIMERS */
+ /* USER CODE BEGIN RTOS_TIMERS */
/* start timers, add new ones, ... */
- /* USER CODE END RTOS_TIMERS */
+ /* USER CODE END RTOS_TIMERS */
- /* USER CODE BEGIN RTOS_QUEUES */
+ /* USER CODE BEGIN RTOS_QUEUES */
/* add queues, ... */
- /* USER CODE END RTOS_QUEUES */
+ /* USER CODE END RTOS_QUEUES */
- /* Create the thread(s) */
- /* creation of mainTask */
- mainTaskHandle = osThreadNew(StartMainTask, NULL, &mainTask_attributes);
+ /* Create the thread(s) */
+ /* creation of mainTask */
+ mainTaskHandle = osThreadNew(StartMainTask, NULL, &mainTask_attributes);
- /* creation of doorHandler */
- doorHandlerHandle = osThreadNew(startDoorHandleTask, NULL, &doorHandler_attributes);
+ /* creation of doorHandler */
+ doorHandlerHandle = osThreadNew(startDoorHandleTask, NULL,
+ &doorHandler_attributes);
- /* USER CODE BEGIN RTOS_THREADS */
+ /* USER CODE BEGIN RTOS_THREADS */
/* add threads, ... */
- /* USER CODE END RTOS_THREADS */
+ /* USER CODE END RTOS_THREADS */
- /* USER CODE BEGIN RTOS_EVENTS */
+ /* USER CODE BEGIN RTOS_EVENTS */
/* add events, ... */
- /* USER CODE END RTOS_EVENTS */
+ /* USER CODE END RTOS_EVENTS */
- /* Start scheduler */
- osKernelStart();
+ /* Start scheduler */
+ osKernelStart();
- /* We should never get here as control is now taken by the scheduler */
- /* Infinite loop */
- /* USER CODE BEGIN WHILE */
+ /* We should never get here as control is now taken by the scheduler */
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
while (1) {
}
- /* USER CODE END WHILE */
+ /* USER CODE END WHILE */
- /* USER CODE BEGIN 3 */
+ /* USER CODE BEGIN 3 */
- /* USER CODE END 3 */
+ /* USER CODE END 3 */
}
/**
- * @brief System Clock Configuration
- * @retval None
- */
-void SystemClock_Config(void)
-{
- RCC_OscInitTypeDef RCC_OscInitStruct = {0};
- RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void) {
+ RCC_OscInitTypeDef RCC_OscInitStruct = { 0 };
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 };
- /** Configure the main internal regulator output voltage
- */
- __HAL_RCC_PWR_CLK_ENABLE();
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_RCC_PWR_CLK_ENABLE();
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
- /** Initializes the RCC Oscillators according to the specified parameters
- * in the RCC_OscInitTypeDef structure.
- */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
- RCC_OscInitStruct.HSIState = RCC_HSI_ON;
- RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
- RCC_OscInitStruct.PLL.PLLM = 16;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
- RCC_OscInitStruct.PLL.PLLQ = 4;
- if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
- {
- Error_Handler();
- }
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
+ RCC_OscInitStruct.PLL.PLLM = 16;
+ RCC_OscInitStruct.PLL.PLLN = 336;
+ RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
+ RCC_OscInitStruct.PLL.PLLQ = 4;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
+ Error_Handler();
+ }
- /** Initializes the CPU, AHB and APB buses clocks
- */
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
- |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
+ | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
- {
- Error_Handler();
- }
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
+ Error_Handler();
+ }
}
/**
- * @brief USART2 Initialization Function
- * @param None
- * @retval None
- */
-static void MX_USART2_UART_Init(void)
-{
+ * @brief USART2 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_USART2_UART_Init(void) {
- /* USER CODE BEGIN USART2_Init 0 */
+ /* USER CODE BEGIN USART2_Init 0 */
- /* USER CODE END USART2_Init 0 */
+ /* USER CODE END USART2_Init 0 */
- /* USER CODE BEGIN USART2_Init 1 */
+ /* USER CODE BEGIN USART2_Init 1 */
- /* USER CODE END USART2_Init 1 */
- huart2.Instance = USART2;
- huart2.Init.BaudRate = 9600;
- huart2.Init.WordLength = UART_WORDLENGTH_8B;
- huart2.Init.StopBits = UART_STOPBITS_1;
- huart2.Init.Parity = UART_PARITY_NONE;
- huart2.Init.Mode = UART_MODE_TX_RX;
- huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
- huart2.Init.OverSampling = UART_OVERSAMPLING_16;
- if (HAL_UART_Init(&huart2) != HAL_OK)
- {
- Error_Handler();
- }
- /* USER CODE BEGIN USART2_Init 2 */
+ /* USER CODE END USART2_Init 1 */
+ huart2.Instance = USART2;
+ huart2.Init.BaudRate = 9600;
+ huart2.Init.WordLength = UART_WORDLENGTH_8B;
+ huart2.Init.StopBits = UART_STOPBITS_1;
+ huart2.Init.Parity = UART_PARITY_NONE;
+ huart2.Init.Mode = UART_MODE_TX_RX;
+ huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart2.Init.OverSampling = UART_OVERSAMPLING_16;
+ if (HAL_UART_Init(&huart2) != HAL_OK) {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART2_Init 2 */
- /* USER CODE END USART2_Init 2 */
+ /* USER CODE END USART2_Init 2 */
}
/**
- * @brief GPIO Initialization Function
- * @param None
- * @retval None
- */
-static void MX_GPIO_Init(void)
-{
- GPIO_InitTypeDef GPIO_InitStruct = {0};
-/* USER CODE BEGIN MX_GPIO_Init_1 */
-/* USER CODE END MX_GPIO_Init_1 */
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void) {
+ GPIO_InitTypeDef GPIO_InitStruct = { 0 };
+ /* USER CODE BEGIN MX_GPIO_Init_1 */
+ /* USER CODE END MX_GPIO_Init_1 */
- /* GPIO Ports Clock Enable */
- __HAL_RCC_GPIOC_CLK_ENABLE();
- __HAL_RCC_GPIOH_CLK_ENABLE();
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE();
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOH_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOA, LD2_Pin|Door_Lock_Pin, GPIO_PIN_RESET);
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOA, LD2_Pin | Door_Lock_Pin, GPIO_PIN_RESET);
- /*Configure GPIO pin : B1_Pin */
- GPIO_InitStruct.Pin = B1_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
+ /*Configure GPIO pin : B1_Pin */
+ GPIO_InitStruct.Pin = B1_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
- /*Configure GPIO pins : LD2_Pin Door_Lock_Pin */
- GPIO_InitStruct.Pin = LD2_Pin|Door_Lock_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ /*Configure GPIO pins : LD2_Pin Door_Lock_Pin */
+ GPIO_InitStruct.Pin = LD2_Pin | Door_Lock_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /*Configure GPIO pin : Door_Sensor_Pin */
- GPIO_InitStruct.Pin = Door_Sensor_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- HAL_GPIO_Init(Door_Sensor_GPIO_Port, &GPIO_InitStruct);
+ /*Configure GPIO pin : Door_Sensor_Pin */
+ GPIO_InitStruct.Pin = Door_Sensor_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ HAL_GPIO_Init(Door_Sensor_GPIO_Port, &GPIO_InitStruct);
-/* USER CODE BEGIN MX_GPIO_Init_2 */
-/* USER CODE END MX_GPIO_Init_2 */
+ /* USER CODE BEGIN MX_GPIO_Init_2 */
+ /* USER CODE END MX_GPIO_Init_2 */
}
/* USER CODE BEGIN 4 */
@@ -315,9 +303,8 @@ static void MX_GPIO_Init(void)
* @retval None
*/
/* USER CODE END Header_StartMainTask */
-void StartMainTask(void *argument)
-{
- /* USER CODE BEGIN 5 */
+void StartMainTask(void *argument) {
+ /* USER CODE BEGIN 5 */
memset(uart_buffer, 0, 10);
/* USER CODE END 2 */
@@ -346,14 +333,14 @@ void StartMainTask(void *argument)
}
uart_index = 0;
memset(uart_buffer, 0, 10);
- } else if (uart_index > sizeof(uart_buffer)-1) {
+ } else if (uart_index > sizeof(uart_buffer) - 1) {
memset(uart_buffer, 0, 10);
- uart_index=0;
+ uart_index = 0;
}
}
vTaskDelay(1);
}
- /* USER CODE END 5 */
+ /* USER CODE END 5 */
}
/* USER CODE BEGIN Header_startDoorHandleTask */
@@ -363,9 +350,8 @@ void StartMainTask(void *argument)
* @retval None
*/
/* USER CODE END Header_startDoorHandleTask */
-void startDoorHandleTask(void *argument)
-{
- /* USER CODE BEGIN startDoorHandleTask */
+void startDoorHandleTask(void *argument) {
+ /* USER CODE BEGIN startDoorHandleTask */
/* Infinite loop */
for (;;) {
door_state = HAL_GPIO_ReadPin(DOOR_SENSOR_BANK, DOOR_SENSOR_PIN);
@@ -374,6 +360,7 @@ void startDoorHandleTask(void *argument)
if (door_state == DOOR_STATE_CLOSED) {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1);
door_lock_state = DOOR_LOCK_LOCKED;
+ door_lock_waiting = false;
} else {
if (!door_lock_waiting) {
door_lock_command_time = HAL_GetTick();
@@ -387,6 +374,7 @@ void startDoorHandleTask(void *argument)
}
} else {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1);
+ door_lock_waiting = false;
door_lock_state = DOOR_LOCK_LOCKED;
}
}
@@ -394,49 +382,58 @@ void startDoorHandleTask(void *argument)
} else if (door_lock_state_command == DOOR_LOCK_UNLOCKED) {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 0);
door_lock_state = DOOR_LOCK_UNLOCKED;
-
+ door_lock_waiting = false;
}
}
+ if(!door_lock_state_command && door_lock_waiting) {
+ door_lock_waiting = false;
+ }
+ if (alarm_active && !door_lock_state_command) {
+ HAL_GPIO_WritePin(ALARM_BANK, ALARM_PIN, 0);
+ alarm_active = false;
+ }
+ if (!door_state && door_lock_state) {
+ HAL_GPIO_WritePin(ALARM_BANK, ALARM_PIN, 1);
+ alarm_active = true;
+ }
//HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, uart_buffer[1]);
- vTaskDelay(100);
+ vTaskDelay(50);
}
- /* USER CODE END startDoorHandleTask */
+ /* USER CODE END startDoorHandleTask */
}
/**
- * @brief Period elapsed callback in non blocking mode
- * @note This function is called when TIM1 interrupt took place, inside
- * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
- * a global variable "uwTick" used as application time base.
- * @param htim : TIM handle
- * @retval None
- */
-void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
-{
- /* USER CODE BEGIN Callback 0 */
+ * @brief Period elapsed callback in non blocking mode
+ * @note This function is called when TIM1 interrupt took place, inside
+ * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
+ * a global variable "uwTick" used as application time base.
+ * @param htim : TIM handle
+ * @retval None
+ */
+void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
+ /* USER CODE BEGIN Callback 0 */
- /* USER CODE END Callback 0 */
- if (htim->Instance == TIM1) {
- HAL_IncTick();
- }
- /* USER CODE BEGIN Callback 1 */
+ /* USER CODE END Callback 0 */
+ if (htim->Instance == TIM1) {
+ HAL_IncTick();
+ }
+ /* USER CODE BEGIN Callback 1 */
- /* USER CODE END Callback 1 */
+ /* USER CODE END Callback 1 */
}
/**
- * @brief This function is executed in case of error occurrence.
- * @retval None
- */
-void Error_Handler(void)
-{
- /* USER CODE BEGIN Error_Handler_Debug */
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void) {
+ /* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq();
while (1) {
}
- /* USER CODE END Error_Handler_Debug */
+ /* USER CODE END Error_Handler_Debug */
}
#ifdef USE_FULL_ASSERT
diff --git a/access_control_stm32/Debug/Core/Src/main.cyclo b/access_control_stm32/Debug/Core/Src/main.cyclo
index 9115097..81a251f 100644
--- a/access_control_stm32/Debug/Core/Src/main.cyclo
+++ b/access_control_stm32/Debug/Core/Src/main.cyclo
@@ -1,8 +1,8 @@
-../Core/Src/main.c:107:5:main 1
-../Core/Src/main.c:189:6:SystemClock_Config 3
-../Core/Src/main.c:236:13:MX_USART2_UART_Init 2
-../Core/Src/main.c:269:13:MX_GPIO_Init 1
-../Core/Src/main.c:318:6:StartMainTask 8
-../Core/Src/main.c:366:6:startDoorHandleTask 8
-../Core/Src/main.c:415:6:HAL_TIM_PeriodElapsedCallback 2
-../Core/Src/main.c:432:6:Error_Handler 1
+../Core/Src/main.c:101:5:main 1
+../Core/Src/main.c:183:6:SystemClock_Config 3
+../Core/Src/main.c:227:13:MX_USART2_UART_Init 2
+../Core/Src/main.c:258:13:MX_GPIO_Init 1
+../Core/Src/main.c:306:6:StartMainTask 8
+../Core/Src/main.c:353:6:startDoorHandleTask 14
+../Core/Src/main.c:414:6:HAL_TIM_PeriodElapsedCallback 2
+../Core/Src/main.c:430:6:Error_Handler 1
diff --git a/access_control_stm32/Debug/Core/Src/main.o b/access_control_stm32/Debug/Core/Src/main.o
index def9ace..382cb36 100644
Binary files a/access_control_stm32/Debug/Core/Src/main.o and b/access_control_stm32/Debug/Core/Src/main.o differ
diff --git a/access_control_stm32/Debug/Core/Src/main.su b/access_control_stm32/Debug/Core/Src/main.su
index 11d44e4..159789e 100644
--- a/access_control_stm32/Debug/Core/Src/main.su
+++ b/access_control_stm32/Debug/Core/Src/main.su
@@ -1,8 +1,8 @@
-../Core/Src/main.c:107:5:main 8 static
-../Core/Src/main.c:189:6:SystemClock_Config 88 static
-../Core/Src/main.c:236:13:MX_USART2_UART_Init 8 static
-../Core/Src/main.c:269:13:MX_GPIO_Init 48 static
-../Core/Src/main.c:318:6:StartMainTask 24 static
-../Core/Src/main.c:366:6:startDoorHandleTask 16 static
-../Core/Src/main.c:415:6:HAL_TIM_PeriodElapsedCallback 16 static
-../Core/Src/main.c:432:6:Error_Handler 4 static,ignoring_inline_asm
+../Core/Src/main.c:101:5:main 8 static
+../Core/Src/main.c:183:6:SystemClock_Config 88 static
+../Core/Src/main.c:227:13:MX_USART2_UART_Init 8 static
+../Core/Src/main.c:258:13:MX_GPIO_Init 48 static
+../Core/Src/main.c:306:6:StartMainTask 24 static
+../Core/Src/main.c:353:6:startDoorHandleTask 16 static
+../Core/Src/main.c:414:6:HAL_TIM_PeriodElapsedCallback 16 static
+../Core/Src/main.c:430:6:Error_Handler 4 static,ignoring_inline_asm
diff --git a/access_control_stm32/Debug/access_control_stm32.elf b/access_control_stm32/Debug/access_control_stm32.elf
index 72a1b82..1c2debe 100644
Binary files a/access_control_stm32/Debug/access_control_stm32.elf and b/access_control_stm32/Debug/access_control_stm32.elf differ
diff --git a/access_control_stm32/Debug/access_control_stm32.list b/access_control_stm32/Debug/access_control_stm32.list
index b6f02f7..1b3fd71 100644
--- a/access_control_stm32/Debug/access_control_stm32.list
+++ b/access_control_stm32/Debug/access_control_stm32.list
@@ -5,25 +5,25 @@ Sections:
Idx Name Size VMA LMA File off Algn
0 .isr_vector 00000198 08000000 08000000 00010000 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
- 1 .text 000054a8 080001a0 080001a0 000101a0 2**4
+ 1 .text 00005528 080001a0 080001a0 000101a0 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
- 2 .rodata 00000090 08005648 08005648 00015648 2**2
+ 2 .rodata 00000090 080056c8 080056c8 000156c8 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
- 3 .ARM.extab 00000000 080056d8 080056d8 00020060 2**0
+ 3 .ARM.extab 00000000 08005758 08005758 00020060 2**0
CONTENTS
- 4 .ARM 00000008 080056d8 080056d8 000156d8 2**2
+ 4 .ARM 00000008 08005758 08005758 00015758 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
- 5 .preinit_array 00000000 080056e0 080056e0 00020060 2**0
+ 5 .preinit_array 00000000 08005760 08005760 00020060 2**0
CONTENTS, ALLOC, LOAD, DATA
- 6 .init_array 00000004 080056e0 080056e0 000156e0 2**2
+ 6 .init_array 00000004 08005760 08005760 00015760 2**2
CONTENTS, ALLOC, LOAD, DATA
- 7 .fini_array 00000004 080056e4 080056e4 000156e4 2**2
+ 7 .fini_array 00000004 08005764 08005764 00015764 2**2
CONTENTS, ALLOC, LOAD, DATA
- 8 .data 00000060 20000000 080056e8 00020000 2**2
+ 8 .data 00000060 20000000 08005768 00020000 2**2
CONTENTS, ALLOC, LOAD, DATA
- 9 .bss 00004bf4 20000060 08005748 00020060 2**2
+ 9 .bss 00004bf4 20000060 080057c8 00020060 2**2
ALLOC
- 10 ._user_heap_stack 00003004 20004c54 08005748 00024c54 2**0
+ 10 ._user_heap_stack 00003004 20004c54 080057c8 00024c54 2**0
ALLOC
11 .ARM.attributes 00000030 00000000 00000000 00020060 2**0
CONTENTS, READONLY
@@ -39,13 +39,13 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, READONLY, DEBUGGING, OCTETS
17 .debug_macro 00003557 00000000 00000000 0003caef 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
- 18 .debug_line 000157ed 00000000 00000000 00040046 2**0
+ 18 .debug_line 00015830 00000000 00000000 00040046 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
- 19 .debug_str 0009856e 00000000 00000000 00055833 2**0
+ 19 .debug_str 0009856e 00000000 00000000 00055876 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
- 20 .debug_frame 000055a0 00000000 00000000 000edda4 2**2
+ 20 .debug_frame 000055a0 00000000 00000000 000edde4 2**2
CONTENTS, READONLY, DEBUGGING, OCTETS
- 21 .debug_line_str 00000059 00000000 00000000 000f3344 2**0
+ 21 .debug_line_str 00000059 00000000 00000000 000f3384 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
Disassembly of section .text:
@@ -64,7 +64,7 @@ Disassembly of section .text:
80001b6: bd10 pop {r4, pc}
80001b8: 20000060 .word 0x20000060
80001bc: 00000000 .word 0x00000000
- 80001c0: 08005630 .word 0x08005630
+ 80001c0: 080056b0 .word 0x080056b0
080001c4 :
80001c4: b508 push {r3, lr}
@@ -76,7 +76,7 @@ Disassembly of section .text:
80001d2: bd08 pop {r3, pc}
80001d4: 00000000 .word 0x00000000
80001d8: 20000064 .word 0x20000064
- 80001dc: 08005630 .word 0x08005630
+ 80001dc: 080056b0 .word 0x080056b0
080001e0 <__aeabi_uldivmod>:
80001e0: b953 cbnz r3, 80001f8 <__aeabi_uldivmod+0x18>
@@ -352,109 +352,109 @@ Disassembly of section .text:
80004da: bf00 nop
080004dc :
+
/**
- * @brief The application entry point.
- * @retval int
- */
-int main(void)
-{
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void) {
80004dc: b580 push {r7, lr}
80004de: af00 add r7, sp, #0
- /* USER CODE END 1 */
+ /* USER CODE END 1 */
- /* MCU Configuration--------------------------------------------------------*/
+ /* MCU Configuration--------------------------------------------------------*/
- /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
- HAL_Init();
- 80004e0: f000 fb92 bl 8000c08
- /* USER CODE BEGIN Init */
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+ 80004e0: f000 fbd0 bl 8000c84
+ /* USER CODE BEGIN Init */
- /* USER CODE END Init */
+ /* USER CODE END Init */
- /* Configure the system clock */
- SystemClock_Config();
+ /* Configure the system clock */
+ SystemClock_Config();
80004e4: f000 f82c bl 8000540
- /* USER CODE BEGIN SysInit */
+ /* USER CODE BEGIN SysInit */
- /* USER CODE END SysInit */
+ /* USER CODE END SysInit */
- /* Initialize all configured peripherals */
- MX_GPIO_Init();
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
80004e8: f000 f8be bl 8000668
- MX_USART2_UART_Init();
+ MX_USART2_UART_Init();
80004ec: f000 f892 bl 8000614
- /* USER CODE BEGIN 2 */
+ /* USER CODE BEGIN 2 */
memset(uart_buffer, 0, 10);
80004f0: 220a movs r2, #10
80004f2: 2100 movs r1, #0
80004f4: 480b ldr r0, [pc, #44] ; (8000524 )
- 80004f6: f004 ffb1 bl 800545c
- /* USER CODE END 2 */
+ 80004f6: f004 fff1 bl 80054dc
+ /* USER CODE END 2 */
- /* Init scheduler */
- osKernelInitialize();
- 80004fa: f002 fa51 bl 80029a0
+ /* Init scheduler */
+ osKernelInitialize();
+ 80004fa: f002 fa8f bl 8002a1c
/* add queues, ... */
- /* USER CODE END RTOS_QUEUES */
+ /* USER CODE END RTOS_QUEUES */
- /* Create the thread(s) */
- /* creation of mainTask */
- mainTaskHandle = osThreadNew(StartMainTask, NULL, &mainTask_attributes);
+ /* Create the thread(s) */
+ /* creation of mainTask */
+ mainTaskHandle = osThreadNew(StartMainTask, NULL, &mainTask_attributes);
80004fe: 4a0a ldr r2, [pc, #40] ; (8000528 )
8000500: 2100 movs r1, #0
8000502: 480a ldr r0, [pc, #40] ; (800052c )
- 8000504: f002 fa96 bl 8002a34
+ 8000504: f002 fad4 bl 8002ab0
8000508: 4603 mov r3, r0
800050a: 4a09 ldr r2, [pc, #36] ; (8000530 )
800050c: 6013 str r3, [r2, #0]
- /* creation of doorHandler */
- doorHandlerHandle = osThreadNew(startDoorHandleTask, NULL, &doorHandler_attributes);
+ /* creation of doorHandler */
+ doorHandlerHandle = osThreadNew(startDoorHandleTask, NULL,
800050e: 4a09 ldr r2, [pc, #36] ; (8000534 )
8000510: 2100 movs r1, #0
8000512: 4809 ldr r0, [pc, #36] ; (8000538 )
- 8000514: f002 fa8e bl 8002a34
+ 8000514: f002 facc bl 8002ab0
8000518: 4603 mov r3, r0
800051a: 4a08 ldr r2, [pc, #32] ; (800053c )
800051c: 6013 str r3, [r2, #0]
- /* USER CODE BEGIN RTOS_EVENTS */
+ /* USER CODE BEGIN RTOS_EVENTS */
/* add events, ... */
- /* USER CODE END RTOS_EVENTS */
+ /* USER CODE END RTOS_EVENTS */
- /* Start scheduler */
- osKernelStart();
- 800051e: f002 fa63 bl 80029e8
+ /* Start scheduler */
+ osKernelStart();
+ 800051e: f002 faa1 bl 8002a64
- /* We should never get here as control is now taken by the scheduler */
- /* Infinite loop */
- /* USER CODE BEGIN WHILE */
+ /* We should never get here as control is now taken by the scheduler */
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
while (1) {
8000522: e7fe b.n 8000522
8000524: 200000c8 .word 0x200000c8
- 8000528: 08005678 .word 0x08005678
+ 8000528: 080056f8 .word 0x080056f8
800052c: 08000761 .word 0x08000761
8000530: 200000c0 .word 0x200000c0
- 8000534: 0800569c .word 0x0800569c
+ 8000534: 0800571c .word 0x0800571c
8000538: 08000855 .word 0x08000855
800053c: 200000c4 .word 0x200000c4
08000540 :
+
/**
- * @brief System Clock Configuration
- * @retval None
- */
-void SystemClock_Config(void)
-{
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void) {
8000540: b580 push {r7, lr}
8000542: b094 sub sp, #80 ; 0x50
8000544: af00 add r7, sp, #0
- RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_OscInitTypeDef RCC_OscInitStruct = { 0 };
8000546: f107 0320 add.w r3, r7, #32
800054a: 2230 movs r2, #48 ; 0x30
800054c: 2100 movs r1, #0
800054e: 4618 mov r0, r3
- 8000550: f004 ff84 bl 800545c
- RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ 8000550: f004 ffc4 bl 80054dc
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 };
8000554: f107 030c add.w r3, r7, #12
8000558: 2200 movs r2, #0
800055a: 601a str r2, [r3, #0]
@@ -463,9 +463,9 @@ void SystemClock_Config(void)
8000560: 60da str r2, [r3, #12]
8000562: 611a str r2, [r3, #16]
- /** Configure the main internal regulator output voltage
- */
- __HAL_RCC_PWR_CLK_ENABLE();
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_RCC_PWR_CLK_ENABLE();
8000564: 2300 movs r3, #0
8000566: 60bb str r3, [r7, #8]
8000568: 4b28 ldr r3, [pc, #160] ; (800060c )
@@ -478,7 +478,7 @@ void SystemClock_Config(void)
8000578: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
800057c: 60bb str r3, [r7, #8]
800057e: 68bb ldr r3, [r7, #8]
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
8000580: 2300 movs r3, #0
8000582: 607b str r3, [r7, #4]
8000584: 4b22 ldr r3, [pc, #136] ; (8000610 )
@@ -492,79 +492,77 @@ void SystemClock_Config(void)
8000598: 607b str r3, [r7, #4]
800059a: 687b ldr r3, [r7, #4]
- /** Initializes the RCC Oscillators according to the specified parameters
- * in the RCC_OscInitTypeDef structure.
- */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
800059c: 2302 movs r3, #2
800059e: 623b str r3, [r7, #32]
- RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
80005a0: 2301 movs r3, #1
80005a2: 62fb str r3, [r7, #44] ; 0x2c
- RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
80005a4: 2310 movs r3, #16
80005a6: 633b str r3, [r7, #48] ; 0x30
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
80005a8: 2302 movs r3, #2
80005aa: 63bb str r3, [r7, #56] ; 0x38
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
80005ac: 2300 movs r3, #0
80005ae: 63fb str r3, [r7, #60] ; 0x3c
- RCC_OscInitStruct.PLL.PLLM = 16;
+ RCC_OscInitStruct.PLL.PLLM = 16;
80005b0: 2310 movs r3, #16
80005b2: 643b str r3, [r7, #64] ; 0x40
- RCC_OscInitStruct.PLL.PLLN = 336;
+ RCC_OscInitStruct.PLL.PLLN = 336;
80005b4: f44f 73a8 mov.w r3, #336 ; 0x150
80005b8: 647b str r3, [r7, #68] ; 0x44
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
+ RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
80005ba: 2304 movs r3, #4
80005bc: 64bb str r3, [r7, #72] ; 0x48
- RCC_OscInitStruct.PLL.PLLQ = 4;
+ RCC_OscInitStruct.PLL.PLLQ = 4;
80005be: 2304 movs r3, #4
80005c0: 64fb str r3, [r7, #76] ; 0x4c
- if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
80005c2: f107 0320 add.w r3, r7, #32
80005c6: 4618 mov r0, r3
- 80005c8: f000 fdf8 bl 80011bc
+ 80005c8: f000 fe36 bl 8001238
80005cc: 4603 mov r3, r0
80005ce: 2b00 cmp r3, #0
80005d0: d001 beq.n 80005d6
- {
- Error_Handler();
- 80005d2: f000 f9d1 bl 8000978
- }
+ Error_Handler();
+ 80005d2: f000 fa0f bl 80009f4
+ }
- /** Initializes the CPU, AHB and APB buses clocks
- */
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
80005d6: 230f movs r3, #15
80005d8: 60fb str r3, [r7, #12]
- |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
80005da: 2302 movs r3, #2
80005dc: 613b str r3, [r7, #16]
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
80005de: 2300 movs r3, #0
80005e0: 617b str r3, [r7, #20]
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
80005e2: f44f 5380 mov.w r3, #4096 ; 0x1000
80005e6: 61bb str r3, [r7, #24]
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
80005e8: 2300 movs r3, #0
80005ea: 61fb str r3, [r7, #28]
- if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
80005ec: f107 030c add.w r3, r7, #12
80005f0: 2102 movs r1, #2
80005f2: 4618 mov r0, r3
- 80005f4: f001 f85a bl 80016ac
+ 80005f4: f001 f898 bl 8001728
80005f8: 4603 mov r3, r0
80005fa: 2b00 cmp r3, #0
80005fc: d001 beq.n 8000602
- {
- Error_Handler();
- 80005fe: f000 f9bb bl 8000978
- }
+ Error_Handler();
+ 80005fe: f000 f9f9 bl 80009f4
+ }
}
8000602: bf00 nop
8000604: 3750 adds r7, #80 ; 0x50
@@ -575,64 +573,63 @@ void SystemClock_Config(void)
8000610: 40007000 .word 0x40007000
08000614 :
- * @brief USART2 Initialization Function
- * @param None
- * @retval None
- */
-static void MX_USART2_UART_Init(void)
-{
+/**
+ * @brief USART2 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_USART2_UART_Init(void) {
8000614: b580 push {r7, lr}
8000616: af00 add r7, sp, #0
- /* USER CODE END USART2_Init 0 */
+ /* USER CODE END USART2_Init 0 */
- /* USER CODE BEGIN USART2_Init 1 */
+ /* USER CODE BEGIN USART2_Init 1 */
- /* USER CODE END USART2_Init 1 */
- huart2.Instance = USART2;
+ /* USER CODE END USART2_Init 1 */
+ huart2.Instance = USART2;
8000618: 4b11 ldr r3, [pc, #68] ; (8000660 )
800061a: 4a12 ldr r2, [pc, #72] ; (8000664 )
800061c: 601a str r2, [r3, #0]
- huart2.Init.BaudRate = 9600;
+ huart2.Init.BaudRate = 9600;
800061e: 4b10 ldr r3, [pc, #64] ; (8000660 )
8000620: f44f 5216 mov.w r2, #9600 ; 0x2580
8000624: 605a str r2, [r3, #4]
- huart2.Init.WordLength = UART_WORDLENGTH_8B;
+ huart2.Init.WordLength = UART_WORDLENGTH_8B;
8000626: 4b0e ldr r3, [pc, #56] ; (8000660 )
8000628: 2200 movs r2, #0
800062a: 609a str r2, [r3, #8]
- huart2.Init.StopBits = UART_STOPBITS_1;
+ huart2.Init.StopBits = UART_STOPBITS_1;
800062c: 4b0c ldr r3, [pc, #48] ; (8000660 )
800062e: 2200 movs r2, #0
8000630: 60da str r2, [r3, #12]
- huart2.Init.Parity = UART_PARITY_NONE;
+ huart2.Init.Parity = UART_PARITY_NONE;
8000632: 4b0b ldr r3, [pc, #44] ; (8000660 )
8000634: 2200 movs r2, #0
8000636: 611a str r2, [r3, #16]
- huart2.Init.Mode = UART_MODE_TX_RX;
+ huart2.Init.Mode = UART_MODE_TX_RX;
8000638: 4b09 ldr r3, [pc, #36] ; (8000660 )
800063a: 220c movs r2, #12
800063c: 615a str r2, [r3, #20]
- huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
800063e: 4b08 ldr r3, [pc, #32] ; (8000660 )
8000640: 2200 movs r2, #0
8000642: 619a str r2, [r3, #24]
- huart2.Init.OverSampling = UART_OVERSAMPLING_16;
+ huart2.Init.OverSampling = UART_OVERSAMPLING_16;
8000644: 4b06 ldr r3, [pc, #24] ; (8000660 )
8000646: 2200 movs r2, #0
8000648: 61da str r2, [r3, #28]
- if (HAL_UART_Init(&huart2) != HAL_OK)
+ if (HAL_UART_Init(&huart2) != HAL_OK) {
800064a: 4805 ldr r0, [pc, #20] ; (8000660 )
- 800064c: f001 fd00 bl 8002050
+ 800064c: f001 fd3e bl 80020cc
8000650: 4603 mov r3, r0
8000652: 2b00 cmp r3, #0
8000654: d001 beq.n 800065a
- {
- Error_Handler();
- 8000656: f000 f98f bl 8000978
- }
- /* USER CODE BEGIN USART2_Init 2 */
+ Error_Handler();
+ 8000656: f000 f9cd bl 80009f4
+ }
+ /* USER CODE BEGIN USART2_Init 2 */
- /* USER CODE END USART2_Init 2 */
+ /* USER CODE END USART2_Init 2 */
}
800065a: bf00 nop
@@ -642,16 +639,16 @@ static void MX_USART2_UART_Init(void)
8000664: 40004400 .word 0x40004400
08000668 :
- * @brief GPIO Initialization Function
- * @param None
- * @retval None
- */
-static void MX_GPIO_Init(void)
-{
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void) {
8000668: b580 push {r7, lr}
800066a: b08a sub sp, #40 ; 0x28
800066c: af00 add r7, sp, #0
- GPIO_InitTypeDef GPIO_InitStruct = {0};
+ GPIO_InitTypeDef GPIO_InitStruct = { 0 };
800066e: f107 0314 add.w r3, r7, #20
8000672: 2200 movs r2, #0
8000674: 601a str r2, [r3, #0]
@@ -659,11 +656,11 @@ static void MX_GPIO_Init(void)
8000678: 609a str r2, [r3, #8]
800067a: 60da str r2, [r3, #12]
800067c: 611a str r2, [r3, #16]
-/* USER CODE BEGIN MX_GPIO_Init_1 */
-/* USER CODE END MX_GPIO_Init_1 */
+ /* USER CODE BEGIN MX_GPIO_Init_1 */
+ /* USER CODE END MX_GPIO_Init_1 */
- /* GPIO Ports Clock Enable */
- __HAL_RCC_GPIOC_CLK_ENABLE();
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
800067e: 2300 movs r3, #0
8000680: 613b str r3, [r7, #16]
8000682: 4b34 ldr r3, [pc, #208] ; (8000754 )
@@ -676,7 +673,7 @@ static void MX_GPIO_Init(void)
8000692: f003 0304 and.w r3, r3, #4
8000696: 613b str r3, [r7, #16]
8000698: 693b ldr r3, [r7, #16]
- __HAL_RCC_GPIOH_CLK_ENABLE();
+ __HAL_RCC_GPIOH_CLK_ENABLE();
800069a: 2300 movs r3, #0
800069c: 60fb str r3, [r7, #12]
800069e: 4b2d ldr r3, [pc, #180] ; (8000754 )
@@ -689,7 +686,7 @@ static void MX_GPIO_Init(void)
80006ae: f003 0380 and.w r3, r3, #128 ; 0x80
80006b2: 60fb str r3, [r7, #12]
80006b4: 68fb ldr r3, [r7, #12]
- __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
80006b6: 2300 movs r3, #0
80006b8: 60bb str r3, [r7, #8]
80006ba: 4b26 ldr r3, [pc, #152] ; (8000754 )
@@ -702,7 +699,7 @@ static void MX_GPIO_Init(void)
80006ca: f003 0301 and.w r3, r3, #1
80006ce: 60bb str r3, [r7, #8]
80006d0: 68bb ldr r3, [r7, #8]
- __HAL_RCC_GPIOB_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
80006d2: 2300 movs r3, #0
80006d4: 607b str r3, [r7, #4]
80006d6: 4b1f ldr r3, [pc, #124] ; (8000754 )
@@ -716,66 +713,66 @@ static void MX_GPIO_Init(void)
80006ea: 607b str r3, [r7, #4]
80006ec: 687b ldr r3, [r7, #4]
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOA, LD2_Pin|Door_Lock_Pin, GPIO_PIN_RESET);
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOA, LD2_Pin | Door_Lock_Pin, GPIO_PIN_RESET);
80006ee: 2200 movs r2, #0
80006f0: f44f 7108 mov.w r1, #544 ; 0x220
80006f4: 4818 ldr r0, [pc, #96] ; (8000758 )
- 80006f6: f000 fd47 bl 8001188
+ 80006f6: f000 fd85 bl 8001204
- /*Configure GPIO pin : B1_Pin */
- GPIO_InitStruct.Pin = B1_Pin;
+ /*Configure GPIO pin : B1_Pin */
+ GPIO_InitStruct.Pin = B1_Pin;
80006fa: f44f 5300 mov.w r3, #8192 ; 0x2000
80006fe: 617b str r3, [r7, #20]
- GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
+ GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
8000700: f44f 1304 mov.w r3, #2162688 ; 0x210000
8000704: 61bb str r3, [r7, #24]
- GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
8000706: 2300 movs r3, #0
8000708: 61fb str r3, [r7, #28]
- HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
+ HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
800070a: f107 0314 add.w r3, r7, #20
800070e: 4619 mov r1, r3
8000710: 4812 ldr r0, [pc, #72] ; (800075c )
- 8000712: f000 fb9d bl 8000e50
+ 8000712: f000 fbdb bl 8000ecc
- /*Configure GPIO pins : LD2_Pin Door_Lock_Pin */
- GPIO_InitStruct.Pin = LD2_Pin|Door_Lock_Pin;
+ /*Configure GPIO pins : LD2_Pin Door_Lock_Pin */
+ GPIO_InitStruct.Pin = LD2_Pin | Door_Lock_Pin;
8000716: f44f 7308 mov.w r3, #544 ; 0x220
800071a: 617b str r3, [r7, #20]
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
800071c: 2301 movs r3, #1
800071e: 61bb str r3, [r7, #24]
- GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
8000720: 2300 movs r3, #0
8000722: 61fb str r3, [r7, #28]
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
8000724: 2300 movs r3, #0
8000726: 623b str r3, [r7, #32]
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
8000728: f107 0314 add.w r3, r7, #20
800072c: 4619 mov r1, r3
800072e: 480a ldr r0, [pc, #40] ; (8000758 )
- 8000730: f000 fb8e bl 8000e50
+ 8000730: f000 fbcc bl 8000ecc
- /*Configure GPIO pin : Door_Sensor_Pin */
- GPIO_InitStruct.Pin = Door_Sensor_Pin;
+ /*Configure GPIO pin : Door_Sensor_Pin */
+ GPIO_InitStruct.Pin = Door_Sensor_Pin;
8000734: 2380 movs r3, #128 ; 0x80
8000736: 617b str r3, [r7, #20]
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
8000738: 2300 movs r3, #0
800073a: 61bb str r3, [r7, #24]
- GPIO_InitStruct.Pull = GPIO_PULLUP;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
800073c: 2301 movs r3, #1
800073e: 61fb str r3, [r7, #28]
- HAL_GPIO_Init(Door_Sensor_GPIO_Port, &GPIO_InitStruct);
+ HAL_GPIO_Init(Door_Sensor_GPIO_Port, &GPIO_InitStruct);
8000740: f107 0314 add.w r3, r7, #20
8000744: 4619 mov r1, r3
8000746: 4804 ldr r0, [pc, #16] ; (8000758 )
- 8000748: f000 fb82 bl 8000e50
+ 8000748: f000 fbc0 bl 8000ecc
-/* USER CODE BEGIN MX_GPIO_Init_2 */
-/* USER CODE END MX_GPIO_Init_2 */
+ /* USER CODE BEGIN MX_GPIO_Init_2 */
+ /* USER CODE END MX_GPIO_Init_2 */
}
800074c: bf00 nop
800074e: 3728 adds r7, #40 ; 0x28
@@ -786,22 +783,22 @@ static void MX_GPIO_Init(void)
800075c: 40020800 .word 0x40020800
08000760 :
+ * @brief Function implementing the mainTask thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_StartMainTask */
-void StartMainTask(void *argument)
-{
+void StartMainTask(void *argument) {
8000760: b580 push {r7, lr}
8000762: b084 sub sp, #16
8000764: af00 add r7, sp, #0
8000766: 6078 str r0, [r7, #4]
- /* USER CODE BEGIN 5 */
+ /* USER CODE BEGIN 5 */
memset(uart_buffer, 0, 10);
8000768: 220a movs r2, #10
800076a: 2100 movs r1, #0
800076c: 4833 ldr r0, [pc, #204] ; (800083c )
- 800076e: f004 fe75 bl 800545c
+ 800076e: f004 feb5 bl 80054dc
/* Infinite loop */
/* USER CODE BEGIN WHILE */
@@ -816,7 +813,7 @@ void StartMainTask(void *argument)
800077c: f44f 737a mov.w r3, #1000 ; 0x3e8
8000780: 2201 movs r2, #1
8000782: 4830 ldr r0, [pc, #192] ; (8000844 )
- 8000784: f001 fd43 bl 800220e
+ 8000784: f001 fd81 bl 800228a
8000788: 4603 mov r3, r0
800078a: 2b00 cmp r3, #0
800078c: d152 bne.n 8000834
@@ -853,7 +850,7 @@ void StartMainTask(void *argument)
80007bc: 461a mov r2, r3
80007be: 2120 movs r1, #32
80007c0: 4821 ldr r0, [pc, #132] ; (8000848 )
- 80007c2: f000 fce1 bl 8001188
+ 80007c2: f000 fd1f bl 8001204
80007c6: e020 b.n 800080a
}
// Get Current Door State
@@ -875,7 +872,7 @@ void StartMainTask(void *argument)
80007e2: f240 53dc movw r3, #1500 ; 0x5dc
80007e6: 2203 movs r2, #3
80007e8: 4816 ldr r0, [pc, #88] ; (8000844 )
- 80007ea: f001 fc7e bl 80020ea
+ 80007ea: f001 fcbc bl 8002166
80007ee: e00c b.n 800080a
}
//
@@ -904,9 +901,9 @@ void StartMainTask(void *argument)
8000810: 220a movs r2, #10
8000812: 2100 movs r1, #0
8000814: 4809 ldr r0, [pc, #36] ; (800083c )
- 8000816: f004 fe21 bl 800545c
+ 8000816: f004 fe61 bl 80054dc
800081a: e00b b.n 8000834
- } else if (uart_index > sizeof(uart_buffer)-1) {
+ } else if (uart_index > sizeof(uart_buffer) - 1) {
800081c: 4b08 ldr r3, [pc, #32] ; (8000840 )
800081e: 781b ldrb r3, [r3, #0]
8000820: 2b09 cmp r3, #9
@@ -915,8 +912,8 @@ void StartMainTask(void *argument)
8000824: 220a movs r2, #10
8000826: 2100 movs r1, #0
8000828: 4804 ldr r0, [pc, #16] ; (800083c )
- 800082a: f004 fe17 bl 800545c
- uart_index=0;
+ 800082a: f004 fe57 bl 80054dc
+ uart_index = 0;
800082e: 4b04 ldr r3, [pc, #16] ; (8000840 )
8000830: 2200 movs r2, #0
8000832: 701a strb r2, [r3, #0]
@@ -924,7 +921,7 @@ void StartMainTask(void *argument)
}
vTaskDelay(1);
8000834: 2001 movs r0, #1
- 8000836: f003 f91b bl 8003a70
+ 8000836: f003 f959 bl 8003aec
if (HAL_UART_Receive(&huart2, uart_buffer + uart_index, 1, 1000)
800083a: e79a b.n 8000772
800083c: 200000c8 .word 0x200000c8
@@ -935,13919 +932,13989 @@ void StartMainTask(void *argument)
8000850: 200000da .word 0x200000da
08000854 :
+ * @brief Function implementing the doorHandler thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_startDoorHandleTask */
-void startDoorHandleTask(void *argument)
-{
+void startDoorHandleTask(void *argument) {
8000854: b580 push {r7, lr}
8000856: b082 sub sp, #8
8000858: af00 add r7, sp, #0
800085a: 6078 str r0, [r7, #4]
- /* USER CODE BEGIN startDoorHandleTask */
+ /* USER CODE BEGIN startDoorHandleTask */
/* Infinite loop */
for (;;) {
door_state = HAL_GPIO_ReadPin(DOOR_SENSOR_BANK, DOOR_SENSOR_PIN);
800085c: 2180 movs r1, #128 ; 0x80
- 800085e: 4835 ldr r0, [pc, #212] ; (8000934 )
- 8000860: f000 fc7a bl 8001158
+ 800085e: 4854 ldr r0, [pc, #336] ; (80009b0 )
+ 8000860: f000 fcb8 bl 80011d4
8000864: 4603 mov r3, r0
8000866: 2b00 cmp r3, #0
8000868: bf14 ite ne
800086a: 2301 movne r3, #1
800086c: 2300 moveq r3, #0
800086e: b2da uxtb r2, r3
- 8000870: 4b31 ldr r3, [pc, #196] ; (8000938 )
+ 8000870: 4b50 ldr r3, [pc, #320] ; (80009b4 )
8000872: 701a strb r2, [r3, #0]
if (door_lock_state != door_lock_state_command) {
- 8000874: 4b31 ldr r3, [pc, #196] ; (800093c )
+ 8000874: 4b50 ldr r3, [pc, #320] ; (80009b8 )
8000876: 781a ldrb r2, [r3, #0]
- 8000878: 4b31 ldr r3, [pc, #196] ; (8000940 )
+ 8000878: 4b50 ldr r3, [pc, #320] ; (80009bc )
800087a: 781b ldrb r3, [r3, #0]
800087c: 429a cmp r2, r3
- 800087e: d055 beq.n 800092c
+ 800087e: d05e beq.n 800093e
if (door_lock_state_command == DOOR_LOCK_LOCKED) {
- 8000880: 4b2f ldr r3, [pc, #188] ; (8000940 )
+ 8000880: 4b4e ldr r3, [pc, #312] ; (80009bc )
8000882: 781b ldrb r3, [r3, #0]
8000884: 2b00 cmp r3, #0
- 8000886: d041 beq.n 800090c
+ 8000886: d047 beq.n 8000918
if (door_state == DOOR_STATE_CLOSED) {
- 8000888: 4b2b ldr r3, [pc, #172] ; (8000938 )
+ 8000888: 4b4a ldr r3, [pc, #296] ; (80009b4 )
800088a: 781b ldrb r3, [r3, #0]
800088c: 2b00 cmp r3, #0
- 800088e: d009 beq.n 80008a4
+ 800088e: d00c beq.n 80008aa
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1);
8000890: 2201 movs r2, #1
8000892: 2100 movs r1, #0
8000894: f44f 7000 mov.w r0, #512 ; 0x200
- 8000898: f000 fc76 bl 8001188
+ 8000898: f000 fcb4 bl 8001204
door_lock_state = DOOR_LOCK_LOCKED;
- 800089c: 4b27 ldr r3, [pc, #156] ; (800093c )
+ 800089c: 4b46 ldr r3, [pc, #280] ; (80009b8 )
800089e: 2201 movs r2, #1
80008a0: 701a strb r2, [r3, #0]
- 80008a2: e043 b.n 800092c
+ door_lock_waiting = false;
+ 80008a2: 4b47 ldr r3, [pc, #284] ; (80009c0 )
+ 80008a4: 2200 movs r2, #0
+ 80008a6: 701a strb r2, [r3, #0]
+ 80008a8: e049 b.n 800093e
} else {
if (!door_lock_waiting) {
- 80008a4: 4b27 ldr r3, [pc, #156] ; (8000944 )
- 80008a6: 781b ldrb r3, [r3, #0]
- 80008a8: f083 0301 eor.w r3, r3, #1
- 80008ac: b2db uxtb r3, r3
- 80008ae: 2b00 cmp r3, #0
- 80008b0: d008 beq.n 80008c4
+ 80008aa: 4b45 ldr r3, [pc, #276] ; (80009c0 )
+ 80008ac: 781b ldrb r3, [r3, #0]
+ 80008ae: f083 0301 eor.w r3, r3, #1
+ 80008b2: b2db uxtb r3, r3
+ 80008b4: 2b00 cmp r3, #0
+ 80008b6: d008 beq.n 80008ca
door_lock_command_time = HAL_GetTick();
- 80008b2: f000 f9df bl 8000c74
- 80008b6: 4603 mov r3, r0
- 80008b8: 4a23 ldr r2, [pc, #140] ; (8000948 )
- 80008ba: 6013 str r3, [r2, #0]
+ 80008b8: f000 fa1a bl 8000cf0
+ 80008bc: 4603 mov r3, r0
+ 80008be: 4a41 ldr r2, [pc, #260] ; (80009c4 )
+ 80008c0: 6013 str r3, [r2, #0]
door_lock_waiting = true;
- 80008bc: 4b21 ldr r3, [pc, #132] ; (8000944 )
- 80008be: 2201 movs r2, #1
- 80008c0: 701a strb r2, [r3, #0]
- 80008c2: e033 b.n 800092c
+ 80008c2: 4b3f ldr r3, [pc, #252] ; (80009c0 )
+ 80008c4: 2201 movs r2, #1
+ 80008c6: 701a strb r2, [r3, #0]
+ 80008c8: e039 b.n 800093e
} else {
if (door_state == DOOR_STATE_OPEN) {
- 80008c4: 4b1c ldr r3, [pc, #112] ; (8000938 )
- 80008c6: 781b ldrb r3, [r3, #0]
- 80008c8: f083 0301 eor.w r3, r3, #1
- 80008cc: b2db uxtb r3, r3
- 80008ce: 2b00 cmp r3, #0
- 80008d0: d012 beq.n 80008f8
+ 80008ca: 4b3a ldr r3, [pc, #232] ; (80009b4 )
+ 80008cc: 781b ldrb r3, [r3, #0]
+ 80008ce: f083 0301 eor.w r3, r3, #1
+ 80008d2: b2db uxtb r3, r3
+ 80008d4: 2b00 cmp r3, #0
+ 80008d6: d012 beq.n 80008fe
if (HAL_GetTick()
- 80008d2: f000 f9cf bl 8000c74
- 80008d6: 4602 mov r2, r0
+ 80008d8: f000 fa0a bl 8000cf0
+ 80008dc: 4602 mov r2, r0
- door_lock_command_time>DOOR_ERROR_ALARM_DELAY) {
- 80008d8: 4b1b ldr r3, [pc, #108] ; (8000948 )
- 80008da: 681b ldr r3, [r3, #0]
- 80008dc: 1ad3 subs r3, r2, r3
+ 80008de: 4b39 ldr r3, [pc, #228] ; (80009c4 )
+ 80008e0: 681b ldr r3, [r3, #0]
+ 80008e2: 1ad3 subs r3, r2, r3
if (HAL_GetTick()
- 80008de: f242 7210 movw r2, #10000 ; 0x2710
- 80008e2: 4293 cmp r3, r2
- 80008e4: d922 bls.n 800092c
+ 80008e4: f242 7210 movw r2, #10000 ; 0x2710
+ 80008e8: 4293 cmp r3, r2
+ 80008ea: d928 bls.n 800093e
alarm_active = true;
- 80008e6: 4b19 ldr r3, [pc, #100] ; (800094c )
- 80008e8: 2201 movs r2, #1
- 80008ea: 701a strb r2, [r3, #0]
+ 80008ec: 4b36 ldr r3, [pc, #216] ; (80009c8 )
+ 80008ee: 2201 movs r2, #1
+ 80008f0: 701a strb r2, [r3, #0]
HAL_GPIO_WritePin(ALARM_BANK, ALARM_PIN, 1);
- 80008ec: 2201 movs r2, #1
- 80008ee: 2101 movs r1, #1
- 80008f0: 4817 ldr r0, [pc, #92] ; (8000950 )
- 80008f2: f000 fc49 bl 8001188
- 80008f6: e019 b.n 800092c
+ 80008f2: 2201 movs r2, #1
+ 80008f4: 2101 movs r1, #1
+ 80008f6: 4835 ldr r0, [pc, #212] ; (80009cc )
+ 80008f8: f000 fc84 bl 8001204
+ 80008fc: e01f b.n 800093e
}
} else {
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 1);
- 80008f8: 2201 movs r2, #1
- 80008fa: 2100 movs r1, #0
- 80008fc: f44f 7000 mov.w r0, #512 ; 0x200
- 8000900: f000 fc42 bl 8001188
+ 80008fe: 2201 movs r2, #1
+ 8000900: 2100 movs r1, #0
+ 8000902: f44f 7000 mov.w r0, #512 ; 0x200
+ 8000906: f000 fc7d bl 8001204
+ door_lock_waiting = false;
+ 800090a: 4b2d ldr r3, [pc, #180] ; (80009c0 )
+ 800090c: 2200 movs r2, #0
+ 800090e: 701a strb r2, [r3, #0]
door_lock_state = DOOR_LOCK_LOCKED;
- 8000904: 4b0d ldr r3, [pc, #52] ; (800093c )
- 8000906: 2201 movs r2, #1
- 8000908: 701a strb r2, [r3, #0]
- 800090a: e00f b.n 800092c
+ 8000910: 4b29 ldr r3, [pc, #164] ; (80009b8 )
+ 8000912: 2201 movs r2, #1
+ 8000914: 701a strb r2, [r3, #0]
+ 8000916: e012 b.n 800093e
}
}
}
} else if (door_lock_state_command == DOOR_LOCK_UNLOCKED) {
- 800090c: 4b0c ldr r3, [pc, #48] ; (8000940 )
- 800090e: 781b ldrb r3, [r3, #0]
- 8000910: f083 0301 eor.w r3, r3, #1
- 8000914: b2db uxtb r3, r3
- 8000916: 2b00 cmp r3, #0
- 8000918: d008 beq.n 800092c
+ 8000918: 4b28 ldr r3, [pc, #160] ; (80009bc )
+ 800091a: 781b ldrb r3, [r3, #0]
+ 800091c: f083 0301 eor.w r3, r3, #1
+ 8000920: b2db uxtb r3, r3
+ 8000922: 2b00 cmp r3, #0
+ 8000924: d00b beq.n 800093e
HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, 0);
- 800091a: 2200 movs r2, #0
- 800091c: 2100 movs r1, #0
- 800091e: f44f 7000 mov.w r0, #512 ; 0x200
- 8000922: f000 fc31 bl 8001188
+ 8000926: 2200 movs r2, #0
+ 8000928: 2100 movs r1, #0
+ 800092a: f44f 7000 mov.w r0, #512 ; 0x200
+ 800092e: f000 fc69 bl 8001204
door_lock_state = DOOR_LOCK_UNLOCKED;
- 8000926: 4b05 ldr r3, [pc, #20] ; (800093c )
- 8000928: 2200 movs r2, #0
- 800092a: 701a strb r2, [r3, #0]
-
+ 8000932: 4b21 ldr r3, [pc, #132] ; (80009b8 )
+ 8000934: 2200 movs r2, #0
+ 8000936: 701a strb r2, [r3, #0]
+ door_lock_waiting = false;
+ 8000938: 4b21 ldr r3, [pc, #132] ; (80009c0 )
+ 800093a: 2200 movs r2, #0
+ 800093c: 701a strb r2, [r3, #0]
}
}
+ if(!door_lock_state_command && door_lock_waiting) {
+ 800093e: 4b1f ldr r3, [pc, #124] ; (80009bc )
+ 8000940: 781b ldrb r3, [r3, #0]
+ 8000942: f083 0301 eor.w r3, r3, #1
+ 8000946: b2db uxtb r3, r3
+ 8000948: 2b00 cmp r3, #0
+ 800094a: d006 beq.n 800095a
+ 800094c: 4b1c ldr r3, [pc, #112] ; (80009c0 )
+ 800094e: 781b ldrb r3, [r3, #0]
+ 8000950: 2b00 cmp r3, #0
+ 8000952: d002 beq.n 800095a
+ door_lock_waiting = false;
+ 8000954: 4b1a ldr r3, [pc, #104] ; (80009c0 )
+ 8000956: 2200 movs r2, #0
+ 8000958: 701a strb r2, [r3, #0]
+ }
+ if (alarm_active && !door_lock_state_command) {
+ 800095a: 4b1b ldr r3, [pc, #108] ; (80009c8 )
+ 800095c: 781b ldrb r3, [r3, #0]
+ 800095e: 2b00 cmp r3, #0
+ 8000960: d00e beq.n 8000980
+ 8000962: 4b16 ldr r3, [pc, #88] ; (80009bc )
+ 8000964: 781b ldrb r3, [r3, #0]
+ 8000966: f083 0301 eor.w r3, r3, #1
+ 800096a: b2db uxtb r3, r3
+ 800096c: 2b00 cmp r3, #0
+ 800096e: d007 beq.n 8000980
+ HAL_GPIO_WritePin(ALARM_BANK, ALARM_PIN, 0);
+ 8000970: 2200 movs r2, #0
+ 8000972: 2101 movs r1, #1
+ 8000974: 4815 ldr r0, [pc, #84] ; (80009cc )
+ 8000976: f000 fc45 bl 8001204
+ alarm_active = false;
+ 800097a: 4b13 ldr r3, [pc, #76] ; (80009c8 )
+ 800097c: 2200 movs r2, #0
+ 800097e: 701a strb r2, [r3, #0]
+ }
+ if (!door_state && door_lock_state) {
+ 8000980: 4b0c ldr r3, [pc, #48] ; (80009b4 )
+ 8000982: 781b ldrb r3, [r3, #0]
+ 8000984: f083 0301 eor.w r3, r3, #1
+ 8000988: b2db uxtb r3, r3
+ 800098a: 2b00 cmp r3, #0
+ 800098c: d00b beq.n 80009a6
+ 800098e: 4b0a ldr r3, [pc, #40] ; (80009b8 )
+ 8000990: 781b ldrb r3, [r3, #0]
+ 8000992: 2b00 cmp r3, #0
+ 8000994: d007 beq.n 80009a6
+ HAL_GPIO_WritePin(ALARM_BANK, ALARM_PIN, 1);
+ 8000996: 2201 movs r2, #1
+ 8000998: 2101 movs r1, #1
+ 800099a: 480c ldr r0, [pc, #48] ; (80009cc )
+ 800099c: f000 fc32 bl 8001204
+ alarm_active = true;
+ 80009a0: 4b09 ldr r3, [pc, #36] ; (80009c8 )
+ 80009a2: 2201 movs r2, #1
+ 80009a4: 701a strb r2, [r3, #0]
+ }
//HAL_GPIO_WritePin(DOOR_LOCK_PIN, DOOR_LOCK_BANK, uart_buffer[1]);
- vTaskDelay(100);
- 800092c: 2064 movs r0, #100 ; 0x64
- 800092e: f003 f89f bl 8003a70
+ vTaskDelay(50);
+ 80009a6: 2032 movs r0, #50 ; 0x32
+ 80009a8: f003 f8a0 bl 8003aec
door_state = HAL_GPIO_ReadPin(DOOR_SENSOR_BANK, DOOR_SENSOR_PIN);
- 8000932: e793 b.n 800085c
- 8000934: 40020000 .word 0x40020000
- 8000938: 200000d8 .word 0x200000d8
- 800093c: 200000d9 .word 0x200000d9
- 8000940: 200000da .word 0x200000da
- 8000944: 200000db .word 0x200000db
- 8000948: 200000d4 .word 0x200000d4
- 800094c: 200000dc .word 0x200000dc
- 8000950: 40020800 .word 0x40020800
+ 80009ac: e756 b.n 800085c
+ 80009ae: bf00 nop
+ 80009b0: 40020000 .word 0x40020000
+ 80009b4: 200000d8 .word 0x200000d8
+ 80009b8: 200000d9 .word 0x200000d9
+ 80009bc: 200000da .word 0x200000da
+ 80009c0: 200000db .word 0x200000db
+ 80009c4: 200000d4 .word 0x200000d4
+ 80009c8: 200000dc .word 0x200000dc
+ 80009cc: 40020800 .word 0x40020800
-08000954 :
- * a global variable "uwTick" used as application time base.
- * @param htim : TIM handle
- * @retval None
- */
-void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
-{
- 8000954: b580 push {r7, lr}
- 8000956: b082 sub sp, #8
- 8000958: af00 add r7, sp, #0
- 800095a: 6078 str r0, [r7, #4]
- /* USER CODE BEGIN Callback 0 */
+080009d0 :
+ * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
+ * a global variable "uwTick" used as application time base.
+ * @param htim : TIM handle
+ * @retval None
+ */
+void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
+ 80009d0: b580 push {r7, lr}
+ 80009d2: b082 sub sp, #8
+ 80009d4: af00 add r7, sp, #0
+ 80009d6: 6078 str r0, [r7, #4]
+ /* USER CODE BEGIN Callback 0 */
- /* USER CODE END Callback 0 */
- if (htim->Instance == TIM1) {
- 800095c: 687b ldr r3, [r7, #4]
- 800095e: 681b ldr r3, [r3, #0]
- 8000960: 4a04 ldr r2, [pc, #16] ; (8000974 )
- 8000962: 4293 cmp r3, r2
- 8000964: d101 bne.n 800096a
- HAL_IncTick();
- 8000966: f000 f971 bl 8000c4c
- }
- /* USER CODE BEGIN Callback 1 */
+ /* USER CODE END Callback 0 */
+ if (htim->Instance == TIM1) {
+ 80009d8: 687b ldr r3, [r7, #4]
+ 80009da: 681b ldr r3, [r3, #0]
+ 80009dc: 4a04 ldr r2, [pc, #16] ; (80009f0 )
+ 80009de: 4293 cmp r3, r2
+ 80009e0: d101 bne.n 80009e6
+ HAL_IncTick();
+ 80009e2: f000 f971 bl 8000cc8
+ }
+ /* USER CODE BEGIN Callback 1 */
- /* USER CODE END Callback 1 */
+ /* USER CODE END Callback 1 */
}
- 800096a: bf00 nop
- 800096c: 3708 adds r7, #8
- 800096e: 46bd mov sp, r7
- 8000970: bd80 pop {r7, pc}
- 8000972: bf00 nop
- 8000974: 40010000 .word 0x40010000
+ 80009e6: bf00 nop
+ 80009e8: 3708 adds r7, #8
+ 80009ea: 46bd mov sp, r7
+ 80009ec: bd80 pop {r7, pc}
+ 80009ee: bf00 nop
+ 80009f0: 40010000 .word 0x40010000
+
+080009f4 :
-08000978 :
/**
- * @brief This function is executed in case of error occurrence.
- * @retval None
- */
-void Error_Handler(void)
-{
- 8000978: b480 push {r7}
- 800097a: af00 add r7, sp, #0
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void) {
+ 80009f4: b480 push {r7}
+ 80009f6: af00 add r7, sp, #0
\details Disables IRQ interrupts by setting the I-bit in the CPSR.
Can only be executed in Privileged modes.
*/
__STATIC_FORCEINLINE void __disable_irq(void)
{
__ASM volatile ("cpsid i" : : : "memory");
- 800097c: b672 cpsid i
+ 80009f8: b672 cpsid i
}
- 800097e: bf00 nop
- /* USER CODE BEGIN Error_Handler_Debug */
+ 80009fa: bf00 nop
+ /* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq();
while (1) {
- 8000980: e7fe b.n 8000980
+ 80009fc: e7fe b.n 80009fc
...
-08000984 :
+08000a00 :
/* USER CODE END 0 */
/**
* Initializes the Global MSP.
*/
void HAL_MspInit(void)
{
- 8000984: b580 push {r7, lr}
- 8000986: b082 sub sp, #8
- 8000988: af00 add r7, sp, #0
+ 8000a00: b580 push {r7, lr}
+ 8000a02: b082 sub sp, #8
+ 8000a04: af00 add r7, sp, #0
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */
__HAL_RCC_SYSCFG_CLK_ENABLE();
- 800098a: 2300 movs r3, #0
- 800098c: 607b str r3, [r7, #4]
- 800098e: 4b12 ldr r3, [pc, #72] ; (80009d8 )
- 8000990: 6c5b ldr r3, [r3, #68] ; 0x44
- 8000992: 4a11 ldr r2, [pc, #68] ; (80009d8 )
- 8000994: f443 4380 orr.w r3, r3, #16384 ; 0x4000
- 8000998: 6453 str r3, [r2, #68] ; 0x44
- 800099a: 4b0f ldr r3, [pc, #60] ; (80009d8 )
- 800099c: 6c5b ldr r3, [r3, #68] ; 0x44
- 800099e: f403 4380 and.w r3, r3, #16384 ; 0x4000
- 80009a2: 607b str r3, [r7, #4]
- 80009a4: 687b ldr r3, [r7, #4]
+ 8000a06: 2300 movs r3, #0
+ 8000a08: 607b str r3, [r7, #4]
+ 8000a0a: 4b12 ldr r3, [pc, #72] ; (8000a54 )
+ 8000a0c: 6c5b ldr r3, [r3, #68] ; 0x44
+ 8000a0e: 4a11 ldr r2, [pc, #68] ; (8000a54 )
+ 8000a10: f443 4380 orr.w r3, r3, #16384 ; 0x4000
+ 8000a14: 6453 str r3, [r2, #68] ; 0x44
+ 8000a16: 4b0f ldr r3, [pc, #60] ; (8000a54 )
+ 8000a18: 6c5b ldr r3, [r3, #68] ; 0x44
+ 8000a1a: f403 4380 and.w r3, r3, #16384 ; 0x4000
+ 8000a1e: 607b str r3, [r7, #4]
+ 8000a20: 687b ldr r3, [r7, #4]
__HAL_RCC_PWR_CLK_ENABLE();
- 80009a6: 2300 movs r3, #0
- 80009a8: 603b str r3, [r7, #0]
- 80009aa: 4b0b ldr r3, [pc, #44] ; (80009d8 )
- 80009ac: 6c1b ldr r3, [r3, #64] ; 0x40
- 80009ae: 4a0a ldr r2, [pc, #40] ; (80009d8 )
- 80009b0: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
- 80009b4: 6413 str r3, [r2, #64] ; 0x40
- 80009b6: 4b08 ldr r3, [pc, #32] ; (80009d8 )
- 80009b8: 6c1b ldr r3, [r3, #64] ; 0x40
- 80009ba: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
- 80009be: 603b str r3, [r7, #0]
- 80009c0: 683b ldr r3, [r7, #0]
+ 8000a22: 2300 movs r3, #0
+ 8000a24: 603b str r3, [r7, #0]
+ 8000a26: 4b0b ldr r3, [pc, #44] ; (8000a54 )
+ 8000a28: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000a2a: 4a0a ldr r2, [pc, #40] ; (8000a54 )
+ 8000a2c: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
+ 8000a30: 6413 str r3, [r2, #64] ; 0x40
+ 8000a32: 4b08 ldr r3, [pc, #32] ; (8000a54 )
+ 8000a34: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000a36: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
+ 8000a3a: 603b str r3, [r7, #0]
+ 8000a3c: 683b ldr r3, [r7, #0]
/* System interrupt init*/
/* PendSV_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);
- 80009c2: 2200 movs r2, #0
- 80009c4: 210f movs r1, #15
- 80009c6: f06f 0001 mvn.w r0, #1
- 80009ca: f000 fa17 bl 8000dfc
+ 8000a3e: 2200 movs r2, #0
+ 8000a40: 210f movs r1, #15
+ 8000a42: f06f 0001 mvn.w r0, #1
+ 8000a46: f000 fa17 bl 8000e78
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
- 80009ce: bf00 nop
- 80009d0: 3708 adds r7, #8
- 80009d2: 46bd mov sp, r7
- 80009d4: bd80 pop {r7, pc}
- 80009d6: bf00 nop
- 80009d8: 40023800 .word 0x40023800
+ 8000a4a: bf00 nop
+ 8000a4c: 3708 adds r7, #8
+ 8000a4e: 46bd mov sp, r7
+ 8000a50: bd80 pop {r7, pc}
+ 8000a52: bf00 nop
+ 8000a54: 40023800 .word 0x40023800
-080009dc :
+08000a58 :
* This function configures the hardware resources used in this example
* @param huart: UART handle pointer
* @retval None
*/
void HAL_UART_MspInit(UART_HandleTypeDef* huart)
{
- 80009dc: b580 push {r7, lr}
- 80009de: b08a sub sp, #40 ; 0x28
- 80009e0: af00 add r7, sp, #0
- 80009e2: 6078 str r0, [r7, #4]
+ 8000a58: b580 push {r7, lr}
+ 8000a5a: b08a sub sp, #40 ; 0x28
+ 8000a5c: af00 add r7, sp, #0
+ 8000a5e: 6078 str r0, [r7, #4]
GPIO_InitTypeDef GPIO_InitStruct = {0};
- 80009e4: f107 0314 add.w r3, r7, #20
- 80009e8: 2200 movs r2, #0
- 80009ea: 601a str r2, [r3, #0]
- 80009ec: 605a str r2, [r3, #4]
- 80009ee: 609a str r2, [r3, #8]
- 80009f0: 60da str r2, [r3, #12]
- 80009f2: 611a str r2, [r3, #16]
+ 8000a60: f107 0314 add.w r3, r7, #20
+ 8000a64: 2200 movs r2, #0
+ 8000a66: 601a str r2, [r3, #0]
+ 8000a68: 605a str r2, [r3, #4]
+ 8000a6a: 609a str r2, [r3, #8]
+ 8000a6c: 60da str r2, [r3, #12]
+ 8000a6e: 611a str r2, [r3, #16]
if(huart->Instance==USART2)
- 80009f4: 687b ldr r3, [r7, #4]
- 80009f6: 681b ldr r3, [r3, #0]
- 80009f8: 4a19 ldr r2, [pc, #100] ; (8000a60 )
- 80009fa: 4293 cmp r3, r2
- 80009fc: d12b bne.n 8000a56
+ 8000a70: 687b ldr r3, [r7, #4]
+ 8000a72: 681b ldr r3, [r3, #0]
+ 8000a74: 4a19 ldr r2, [pc, #100] ; (8000adc )
+ 8000a76: 4293 cmp r3, r2
+ 8000a78: d12b bne.n 8000ad2
{
/* USER CODE BEGIN USART2_MspInit 0 */
/* USER CODE END USART2_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_USART2_CLK_ENABLE();
- 80009fe: 2300 movs r3, #0
- 8000a00: 613b str r3, [r7, #16]
- 8000a02: 4b18 ldr r3, [pc, #96] ; (8000a64 )
- 8000a04: 6c1b ldr r3, [r3, #64] ; 0x40
- 8000a06: 4a17 ldr r2, [pc, #92] ; (8000a64 )
- 8000a08: f443 3300 orr.w r3, r3, #131072 ; 0x20000
- 8000a0c: 6413 str r3, [r2, #64] ; 0x40
- 8000a0e: 4b15 ldr r3, [pc, #84] ; (8000a64 )
- 8000a10: 6c1b ldr r3, [r3, #64] ; 0x40
- 8000a12: f403 3300 and.w r3, r3, #131072 ; 0x20000
- 8000a16: 613b str r3, [r7, #16]
- 8000a18: 693b ldr r3, [r7, #16]
+ 8000a7a: 2300 movs r3, #0
+ 8000a7c: 613b str r3, [r7, #16]
+ 8000a7e: 4b18 ldr r3, [pc, #96] ; (8000ae0 )
+ 8000a80: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000a82: 4a17 ldr r2, [pc, #92] ; (8000ae0 )
+ 8000a84: f443 3300 orr.w r3, r3, #131072 ; 0x20000
+ 8000a88: 6413 str r3, [r2, #64] ; 0x40
+ 8000a8a: 4b15 ldr r3, [pc, #84] ; (8000ae0 )
+ 8000a8c: 6c1b ldr r3, [r3, #64] ; 0x40
+ 8000a8e: f403 3300 and.w r3, r3, #131072 ; 0x20000
+ 8000a92: 613b str r3, [r7, #16]
+ 8000a94: 693b ldr r3, [r7, #16]
__HAL_RCC_GPIOA_CLK_ENABLE();
- 8000a1a: 2300 movs r3, #0
- 8000a1c: 60fb str r3, [r7, #12]
- 8000a1e: 4b11 ldr r3, [pc, #68] ; (8000a64 )
- 8000a20: 6b1b ldr r3, [r3, #48] ; 0x30
- 8000a22: 4a10 ldr r2, [pc, #64] ; (8000a64 )
- 8000a24: f043 0301 orr.w r3, r3, #1
- 8000a28: 6313 str r3, [r2, #48] ; 0x30
- 8000a2a: 4b0e ldr r3, [pc, #56] ; (8000a64 )
- 8000a2c: 6b1b ldr r3, [r3, #48] ; 0x30
- 8000a2e: f003 0301 and.w r3, r3, #1
- 8000a32: 60fb str r3, [r7, #12]
- 8000a34: 68fb ldr r3, [r7, #12]
+ 8000a96: 2300 movs r3, #0
+ 8000a98: 60fb str r3, [r7, #12]
+ 8000a9a: 4b11 ldr r3, [pc, #68] ; (8000ae0 )
+ 8000a9c: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000a9e: 4a10 ldr r2, [pc, #64] ; (8000ae0 )
+ 8000aa0: f043 0301 orr.w r3, r3, #1
+ 8000aa4: 6313 str r3, [r2, #48] ; 0x30
+ 8000aa6: 4b0e ldr r3, [pc, #56] ; (8000ae0 )
+ 8000aa8: 6b1b ldr r3, [r3, #48] ; 0x30
+ 8000aaa: f003 0301 and.w r3, r3, #1
+ 8000aae: 60fb str r3, [r7, #12]
+ 8000ab0: 68fb ldr r3, [r7, #12]
/**USART2 GPIO Configuration
PA2 ------> USART2_TX
PA3 ------> USART2_RX
*/
GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin;
- 8000a36: 230c movs r3, #12
- 8000a38: 617b str r3, [r7, #20]
+ 8000ab2: 230c movs r3, #12
+ 8000ab4: 617b str r3, [r7, #20]
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- 8000a3a: 2302 movs r3, #2
- 8000a3c: 61bb str r3, [r7, #24]
+ 8000ab6: 2302 movs r3, #2
+ 8000ab8: 61bb str r3, [r7, #24]
GPIO_InitStruct.Pull = GPIO_NOPULL;
- 8000a3e: 2300 movs r3, #0
- 8000a40: 61fb str r3, [r7, #28]
+ 8000aba: 2300 movs r3, #0
+ 8000abc: 61fb str r3, [r7, #28]
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- 8000a42: 2303 movs r3, #3
- 8000a44: 623b str r3, [r7, #32]
+ 8000abe: 2303 movs r3, #3
+ 8000ac0: 623b str r3, [r7, #32]
GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
- 8000a46: 2307 movs r3, #7
- 8000a48: 627b str r3, [r7, #36] ; 0x24
+ 8000ac2: 2307 movs r3, #7
+ 8000ac4: 627b str r3, [r7, #36] ; 0x24
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- 8000a4a: f107 0314 add.w r3, r7, #20
- 8000a4e: 4619 mov r1, r3
- 8000a50: 4805 ldr r0, [pc, #20] ; (8000a68 )
- 8000a52: f000 f9fd bl 8000e50
+ 8000ac6: f107 0314 add.w r3, r7, #20
+ 8000aca: 4619 mov r1, r3
+ 8000acc: 4805 ldr r0, [pc, #20] ; (8000ae4 )
+ 8000ace: f000 f9fd bl 8000ecc
/* USER CODE BEGIN USART2_MspInit 1 */
/* USER CODE END USART2_MspInit 1 */
}
}
- 8000a56: bf00 nop
- 8000a58: 3728 adds r7, #40 ; 0x28
- 8000a5a: 46bd mov sp, r7
- 8000a5c: bd80 pop {r7, pc}
- 8000a5e: bf00 nop
- 8000a60: 40004400 .word 0x40004400
- 8000a64: 40023800 .word 0x40023800
- 8000a68: 40020000 .word 0x40020000
+ 8000ad2: bf00 nop
+ 8000ad4: 3728 adds r7, #40 ; 0x28
+ 8000ad6: 46bd mov sp, r7
+ 8000ad8: bd80 pop {r7, pc}
+ 8000ada: bf00 nop
+ 8000adc: 40004400 .word 0x40004400
+ 8000ae0: 40023800 .word 0x40023800
+ 8000ae4: 40020000 .word 0x40020000
-08000a6c :
+08000ae8 :
* reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
* @param TickPriority: Tick interrupt priority.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
- 8000a6c: b580 push {r7, lr}
- 8000a6e: b08c sub sp, #48 ; 0x30
- 8000a70: af00 add r7, sp, #0
- 8000a72: 6078 str r0, [r7, #4]
+ 8000ae8: b580 push {r7, lr}
+ 8000aea: b08c sub sp, #48 ; 0x30
+ 8000aec: af00 add r7, sp, #0
+ 8000aee: 6078 str r0, [r7, #4]
RCC_ClkInitTypeDef clkconfig;
uint32_t uwTimclock = 0U;
- 8000a74: 2300 movs r3, #0
- 8000a76: 62bb str r3, [r7, #40] ; 0x28
+ 8000af0: 2300 movs r3, #0
+ 8000af2: 62bb str r3, [r7, #40] ; 0x28
uint32_t uwPrescalerValue = 0U;
- 8000a78: 2300 movs r3, #0
- 8000a7a: 627b str r3, [r7, #36] ; 0x24
+ 8000af4: 2300 movs r3, #0
+ 8000af6: 627b str r3, [r7, #36] ; 0x24
uint32_t pFLatency;
HAL_StatusTypeDef status;
/* Enable TIM1 clock */
__HAL_RCC_TIM1_CLK_ENABLE();
- 8000a7c: 2300 movs r3, #0
- 8000a7e: 60bb str r3, [r7, #8]
- 8000a80: 4b2e ldr r3, [pc, #184] ; (8000b3c )
- 8000a82: 6c5b ldr r3, [r3, #68] ; 0x44
- 8000a84: 4a2d ldr r2, [pc, #180] ; (8000b3c