-
-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
56 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ | |
[env:esp01_8266] | ||
platform = espressif | ||
board = esp01 | ||
build_flags = -Wl,-T"eagle.app.v6.ld" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "ets_sys.h" | ||
#include "osapi.h" | ||
#include "gpio.h" | ||
#include "os_type.h" | ||
|
||
static const int pin = 1; | ||
static volatile os_timer_t some_timer; | ||
|
||
void some_timerfunc(void *arg) | ||
{ | ||
//Do blinky stuff | ||
if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & (1 << pin)) | ||
{ | ||
// set gpio low | ||
gpio_output_set(0, (1 << pin), 0, 0); | ||
} | ||
else | ||
{ | ||
// set gpio high | ||
gpio_output_set((1 << pin), 0, 0, 0); | ||
} | ||
} | ||
|
||
void ICACHE_FLASH_ATTR user_init() | ||
{ | ||
// init gpio sussytem | ||
gpio_init(); | ||
|
||
// configure UART TXD to be GPIO1, set as output | ||
PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_GPIO1); | ||
gpio_output_set(0, 0, (1 << pin), 0); | ||
|
||
// setup timer (500ms, repeating) | ||
os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL); | ||
os_timer_arm(&some_timer, 1000, 1); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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