File tree 4 files changed +18
-24
lines changed 4 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ TARGET = app
26
26
27
27
# which modules (subdirectories) of the project to include in compiling
28
28
MODULES = driver user
29
- EXTRA_INCDIR = include /usr/include /usr/ include/i386-linux-gnu
29
+ EXTRA_INCDIR = include /opt/Espressif/ include
30
30
31
31
# libraries used in this project, mainly provided by the SDK
32
- LIBS = c gcc hal phy net80211 lwip wpa main
32
+ LIBS = c gcc hal phy net80211 lwip wpa upgrade upgrade_ssl main
33
33
34
34
# compiler flags using during compilation of source files
35
35
CFLAGS = -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH
@@ -101,7 +101,7 @@ $1/%.o: %.c
101
101
$(Q ) $(CC ) $(INCDIR ) $(MODULE_INCDIR ) $(EXTRA_INCDIR ) $(SDK_INCDIR ) $(CFLAGS ) -c $$< -o $$@
102
102
endef
103
103
104
- .PHONY : all checkdirs clean
104
+ .PHONY : all checkdirs flash clean
105
105
106
106
all : checkdirs $(TARGET_OUT ) $(FW_FILE_1 ) $(FW_FILE_2 )
107
107
@@ -130,9 +130,7 @@ firmware:
130
130
$(Q ) mkdir -p $@
131
131
132
132
flash : firmware/0x00000.bin firmware/0x40000.bin
133
- -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x00000 firmware/0x00000.bin
134
- sleep 3
135
- -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x40000 firmware/0x40000.bin
133
+ -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
136
134
137
135
clean :
138
136
$(Q ) rm -f $(APP_AR )
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ TARGET = app
26
26
27
27
# which modules (subdirectories) of the project to include in compiling
28
28
MODULES = driver user
29
- EXTRA_INCDIR = include /usr/include /usr/ include/i386-linux-gnu
29
+ EXTRA_INCDIR = include /opt/Espressif/ include
30
30
31
31
# libraries used in this project, mainly provided by the SDK
32
- LIBS = c gcc hal phy net80211 lwip wpa main
32
+ LIBS = c gcc hal phy net80211 lwip wpa upgrade upgrade_ssl main
33
33
34
34
# compiler flags using during compilation of source files
35
35
CFLAGS = -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH
@@ -101,7 +101,7 @@ $1/%.o: %.c
101
101
$(Q ) $(CC ) $(INCDIR ) $(MODULE_INCDIR ) $(EXTRA_INCDIR ) $(SDK_INCDIR ) $(CFLAGS ) -c $$< -o $$@
102
102
endef
103
103
104
- .PHONY : all checkdirs clean
104
+ .PHONY : all checkdirs flash clean
105
105
106
106
all : checkdirs $(TARGET_OUT ) $(FW_FILE_1 ) $(FW_FILE_2 )
107
107
@@ -130,9 +130,7 @@ firmware:
130
130
$(Q ) mkdir -p $@
131
131
132
132
flash : firmware/0x00000.bin firmware/0x40000.bin
133
- -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x00000 firmware/0x00000.bin
134
- sleep 3
135
- -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x40000 firmware/0x40000.bin
133
+ -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
136
134
137
135
clean :
138
136
$(Q ) rm -f $(APP_AR )
Original file line number Diff line number Diff line change 9
9
os_event_t user_procTaskQueue [user_procTaskQueueLen ];
10
10
static void user_procTask (os_event_t * events );
11
11
12
- extern uint32_t PIN_OUT ;
13
- #define CHECK_BIT (var ,pos ) ((var) & (1<<(pos)))
14
-
15
12
static volatile os_timer_t some_timer ;
16
13
17
14
18
15
void some_timerfunc (void * arg )
19
16
{
20
17
//Do blinky stuff
21
- if (CHECK_BIT ( PIN_OUT , 2 ) )
18
+ if (GPIO_REG_READ ( GPIO_OUT_ADDRESS ) & BIT2 )
22
19
{
23
- //Set GPIO2 to HIGH
24
- gpio_output_set (BIT2 , 0 , BIT2 , 0 );
20
+ //Set GPIO2 to LOW
21
+ gpio_output_set (0 , BIT2 , BIT2 , 0 );
25
22
}
26
23
else
27
24
{
28
- //Set GPIO2 to LOW
29
- gpio_output_set (0 , BIT2 , BIT2 , 0 );
25
+ //Set GPIO2 to HIGH
26
+ gpio_output_set (BIT2 , 0 , BIT2 , 0 );
30
27
}
31
28
}
32
29
@@ -41,6 +38,9 @@ user_procTask(os_event_t *events)
41
38
void ICACHE_FLASH_ATTR
42
39
user_init ()
43
40
{
41
+ // Initialize the GPIO subsystem.
42
+ gpio_init ();
43
+
44
44
//Set GPIO2 to output mode
45
45
PIN_FUNC_SELECT (PERIPHS_IO_MUX_GPIO2_U , FUNC_GPIO2 );
46
46
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ TARGET = app
27
27
28
28
# which modules (subdirectories) of the project to include in compiling
29
29
MODULES = driver user
30
- EXTRA_INCDIR = include /opt/Espressif/include/
30
+ EXTRA_INCDIR = include /opt/Espressif/include
31
31
32
32
# libraries used in this project, mainly provided by the SDK
33
33
LIBS = c gcc hal phy net80211 lwip wpa upgrade upgrade_ssl main
@@ -131,9 +131,7 @@ firmware:
131
131
$(Q ) mkdir -p $@
132
132
133
133
flash : firmware/0x00000.bin firmware/0x40000.bin
134
- -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x00000 firmware/0x00000.bin
135
- sleep 3
136
- -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x40000 firmware/0x40000.bin
134
+ -$(ESPTOOL ) --port $(ESPPORT ) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
137
135
138
136
clean :
139
137
$(Q ) rm -f $(APP_AR )
You can’t perform that action at this time.
0 commit comments