File tree 1 file changed +8
-8
lines changed 1 file changed +8
-8
lines changed 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
You can’t perform that action at this time.
0 commit comments