Skip to content

Instantly share code, notes, and snippets.

@aula9
Created September 1, 2024 05:16
Show Gist options
  • Select an option

  • Save aula9/3723c8d723bb1b15addf8adb69cee6c4 to your computer and use it in GitHub Desktop.

Select an option

Save aula9/3723c8d723bb1b15addf8adb69cee6c4 to your computer and use it in GitHub Desktop.
main.c
/*
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