Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Removed some unnecessary task scheduling stuff#14

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
swedishhat wants to merge1 commit intoesp8266:master
base:master
Choose a base branch
Loading
fromswedishhat:master
Open
Changes fromall commits
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
34 changes: 10 additions & 24 deletionsblinky/user/user_main.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "os_type.h"
#include "user_config.h"

#define user_procTaskPrio 0
#define user_procTaskQueueLen 1
os_event_t user_procTaskQueue[user_procTaskQueueLen];
static void user_procTask(os_event_t *events);
#include "ets_sys.h" // Event signals and task priorities
#include "osapi.h" // General ESP functions (timers, strings, memory)
#include "gpio.h" // Interacting and configuring pins
#include "os_type.h" // Mapping to ETS structures
#include "user_config.h" // Any user-defined functions. Alway required.

// create os_timer that's not optimized by the compiler and is file-wide in scope
static volatile os_timer_t some_timer;


// Function to drive GPIO pin high or low
void some_timerfunc(void *arg)
{
//Do blinky stuff
// If GPIO_2 is set HIGH, set it LOW
if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & BIT2)
{
//Set GPIO2 to LOW
Expand All@@ -27,15 +23,8 @@ void some_timerfunc(void *arg)
}
}

//Do nothing function
static void ICACHE_FLASH_ATTR
user_procTask(os_event_t *events)
{
os_delay_us(10);
}

//Init function
void ICACHE_FLASH_ATTR
// Init function
void ICACHE_FLASH_ATTR // Store function in flash memory instead of RAM
user_init()
{
// Initialize the GPIO subsystem.
Expand All@@ -58,7 +47,4 @@ user_init()
//1000 is the fire time in ms
//0 for once and 1 for repeating
os_timer_arm(&some_timer, 1000, 1);

//Start os task
system_os_task(user_procTask, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen);
}

[8]ページ先頭

©2009-2025 Movatter.jp