Created
September 1, 2024 05:16
-
-
Save aula9/3723c8d723bb1b15addf8adb69cee6c4 to your computer and use it in GitHub Desktop.
main.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| BitzOS (BOS) V0.3.6 - Copyright (C) 2017-2024 Hexabitz | |
| All rights reserved | |
| File Name : main.c | |
| Description : Main program body. | |
| */ | |
| /* Includes ------------------------------------------------------------------*/ | |
| #include "BOS.h" | |
| /* Private variables ---------------------------------------------------------*/ | |
| float Sample; | |
| float ecgFilteredSample; | |
| /* Private function prototypes -----------------------------------------------*/ | |
| /* Main function ------------------------------------------------------------*/ | |
| int main(void) { | |
| Module_Init(); //Initialize Module & BitzOS | |
| //Don't place your code here. | |
| for (;;) { | |
| } | |
| } | |
| /*-----------------------------------------------------------*/ | |
| /* User Task */ | |
| void UserTask(void *argument) { | |
| // put your code here, to run repeatedly. | |
| while (1) { | |
| ECG_Sample(& Sample, & ecgFilteredSample); | |
| if(Sample > 2.2) { | |
| HAL_GPIO_WritePin(GPIOD,GPIO_PIN_3, 1); //p5 - Top | |
| HAL_Delay(50); | |
| HAL_GPIO_WritePin(GPIOD,GPIO_PIN_3, 0); } | |
| } | |
| } | |
| /*-----------------------------------------------------------*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment