Metal Detector
 
Loading...
Searching...
No Matches
app_tasks.c File Reference

Application tasks for signal processing, metal detecting, and LVGL GUI updates. More...

#include "app_tasks.h"
#include "signal.h"
#include "lvgl.h"
#include "ui.h"
#include "app_signal.h"
#include "metal_detecting.h"
#include "main.h"

Functions

void ProduceAudioTask (void *argument)
 Task to produce audio when metal is detected.
 
void SignalProcessingTask (void *argument)
 Task to process signals and detect metal.
 
void LvHandlerTask (void *argument)
 Task to handle LVGL GUI updates.
 

Variables

static MD_DetectStatus_t md_flag = NO_TARGET
 
static int16_t phase_diff = 0
 
static uint16_t magnitude = 0
 

Detailed Description

Application tasks for signal processing, metal detecting, and LVGL GUI updates.

This file contains the implementation of various tasks:

  • ProduceAudioTask: Manages audio output for detected targets.
  • SignalProcessingTask: Handles signal acquisition, processing, and metal detection.
  • LvHandlerTask: Manages updates to the LVGL user interface based on signal processing results.

Created on: Jul 21, 2024 Author: Viktor

Function Documentation

◆ LvHandlerTask()

void LvHandlerTask ( void * argument)

Task to handle LVGL GUI updates.

This task updates the LVGL user interface with signal processing results, including depth bar, phase arc, and charts for time and frequency domains.

Parameters
argumentTask argument (unused).

◆ ProduceAudioTask()

void ProduceAudioTask ( void * argument)

Task to produce audio when metal is detected.

This task waits for the AudioSemaphoreHandle to be released, then enables the audio amplifier for a specified duration to produce an audio signal.

Parameters
argumentTask argument (unused).

◆ SignalProcessingTask()

void SignalProcessingTask ( void * argument)

Task to process signals and detect metal.

This task waits for a flag from the input queue, processes the signal to perform FFT and detect metal, and updates detection status and phase difference.

Parameters
argumentTask argument (unused).

Variable Documentation

◆ magnitude

uint16_t magnitude = 0
static

Magnitude of the received signal

◆ md_flag

MD_DetectStatus_t md_flag = NO_TARGET
static

Metal detection flag

◆ phase_diff

int16_t phase_diff = 0
static

Phase difference between signals