Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add blind spot #11

Open
wants to merge 5 commits into
base: v5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/blind_spot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
idf_component_register(
SRCS "src/blind_spot.c"
INCLUDE_DIRS "include"
REQUIRES system driver
)
3 changes: 3 additions & 0 deletions components/blind_spot/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: "0.1.0"
description: "task example"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update description

url: "https://github.com/Parahybaja/firmware"
29 changes: 29 additions & 0 deletions components/blind_spot/include/task/blind_spot.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @file task_blind_spot.h
* @author Flaviano Medeiros da Silva Júnior ([email protected])
* @brief task blind spot
* @version 0.1
* @date 2024-01-22
*
* @copyright Copyright (c) 2024
*
* Version Modified By Date Comments
* ------- ------------- ---------- -----------
* 0.1.0 Flaviano Jr. 22/01/2024 first version
*
*/

#pragma once

#include "system.h"
#include "driver/gpio.h"

#ifdef __cplusplus
extern "C" {
#endif

void task_blind_spot(void*);

#ifdef __cplusplus
}
#endif
35 changes: 35 additions & 0 deletions components/blind_spot/src/blind_spot.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "task/blind_spot.h"

static const char *TAG = "blind_spot";

void task_blind_spot(void *arg){
(void)arg;

const gpio_num_t gpio_pin = (gpio_num_t)arg;

// -----config gpio-----
//zero-initialize the config structure.
gpio_config_t io_conf = {};
//disable interrupt
io_conf.intr_type = GPIO_INTR_DISABLE;
//set as output mode
io_conf.mode = GPIO_MODE_INPUT;
//bit mask of the pins that you want to set
io_conf.pin_bit_mask = (1ULL<<gpio_pin);
//disable pull-down mode
io_conf.pull_down_en = false;
//disable pull-up mode
io_conf.pull_up_en = false;
//configure GPIO with the given settings
ESP_ERROR_CHECK(gpio_config(&io_conf));

task_remaining_space();

for (;;) {
// do something
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary comments from task example

ESP_LOGI(TAG, "CPU Blind Spot");
gpio_set_level(gpio_pin, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add blind spot logic


vTaskDelay(pdMS_TO_TICKS(1000));
}
}