Changed os_intr_xxx to ets_intr_xxx.
The os_intr_xxx macros no longer exist in the SDK.
This commit is contained in:
parent
3b9a42e254
commit
d2ac5f1712
|
@ -253,7 +253,7 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
|
||||||
// delay(wakeupDelay);
|
// delay(wakeupDelay);
|
||||||
for (i = 0; i < wakeupDelay; i++) os_delay_us(1000);
|
for (i = 0; i < wakeupDelay; i++) os_delay_us(1000);
|
||||||
// Disable interrupts
|
// Disable interrupts
|
||||||
os_intr_lock();
|
ets_intr_lock();
|
||||||
// digitalWrite(pin, HIGH); // T-go
|
// digitalWrite(pin, HIGH); // T-go
|
||||||
DIRECT_WRITE_HIGH(pin);
|
DIRECT_WRITE_HIGH(pin);
|
||||||
os_delay_us(40);
|
os_delay_us(40);
|
||||||
|
@ -306,7 +306,7 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Enable interrupts
|
// Enable interrupts
|
||||||
os_intr_unlock();
|
ets_intr_unlock();
|
||||||
// pinMode(pin, OUTPUT);
|
// pinMode(pin, OUTPUT);
|
||||||
DIRECT_MODE_OUTPUT(pin);
|
DIRECT_MODE_OUTPUT(pin);
|
||||||
// digitalWrite(pin, HIGH);
|
// digitalWrite(pin, HIGH);
|
||||||
|
@ -316,4 +316,4 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// END OF FILE
|
// END OF FILE
|
||||||
//
|
//
|
||||||
|
|
|
@ -60,8 +60,8 @@ sample code bearing this copyright.
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "osapi.h"
|
#include "osapi.h"
|
||||||
|
|
||||||
#define noInterrupts os_intr_lock
|
#define noInterrupts ets_intr_lock
|
||||||
#define interrupts os_intr_unlock
|
#define interrupts ets_intr_unlock
|
||||||
#define delayMicroseconds os_delay_us
|
#define delayMicroseconds os_delay_us
|
||||||
|
|
||||||
// 1 for keeping the parasitic power on H
|
// 1 for keeping the parasitic power on H
|
||||||
|
|
|
@ -64,7 +64,7 @@ static int lgpio_trig( lua_State* L )
|
||||||
}else if(sl == 4 && c_strcmp(str, "down") == 0){
|
}else if(sl == 4 && c_strcmp(str, "down") == 0){
|
||||||
type = GPIO_PIN_INTR_NEGEDGE;
|
type = GPIO_PIN_INTR_NEGEDGE;
|
||||||
}else if(sl == 4 && c_strcmp(str, "both") == 0){
|
}else if(sl == 4 && c_strcmp(str, "both") == 0){
|
||||||
type = GPIO_PIN_INTR_ANYEGDE;
|
type = GPIO_PIN_INTR_ANYEDGE;
|
||||||
}else if(sl == 3 && c_strcmp(str, "low") == 0){
|
}else if(sl == 3 && c_strcmp(str, "low") == 0){
|
||||||
type = GPIO_PIN_INTR_LOLEVEL;
|
type = GPIO_PIN_INTR_LOLEVEL;
|
||||||
}else if(sl == 4 && c_strcmp(str, "high") == 0){
|
}else if(sl == 4 && c_strcmp(str, "high") == 0){
|
||||||
|
@ -147,8 +147,8 @@ static int lgpio_write( lua_State* L )
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DELAY_TABLE_MAX_LEN 256
|
#define DELAY_TABLE_MAX_LEN 256
|
||||||
#define noInterrupts os_intr_lock
|
#define noInterrupts ets_intr_lock
|
||||||
#define interrupts os_intr_unlock
|
#define interrupts ets_intr_unlock
|
||||||
#define delayMicroseconds os_delay_us
|
#define delayMicroseconds os_delay_us
|
||||||
#define DIRECT_WRITE(pin, level) (GPIO_OUTPUT_SET(GPIO_ID_PIN(pin_num[pin]), level))
|
#define DIRECT_WRITE(pin, level) (GPIO_OUTPUT_SET(GPIO_ID_PIN(pin_num[pin]), level))
|
||||||
// Lua: serout( pin, firstLevel, delay_table, [repeatNum] )
|
// Lua: serout( pin, firstLevel, delay_table, [repeatNum] )
|
||||||
|
|
|
@ -115,11 +115,11 @@ static int ICACHE_FLASH_ATTR ws2801_writergb(lua_State* L) {
|
||||||
|
|
||||||
os_delay_us(10);
|
os_delay_us(10);
|
||||||
|
|
||||||
os_intr_lock();
|
ets_intr_lock();
|
||||||
|
|
||||||
ws2801_strip(buffer, length);
|
ws2801_strip(buffer, length);
|
||||||
|
|
||||||
os_intr_unlock();
|
ets_intr_unlock();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,9 +94,9 @@ static int ICACHE_FLASH_ATTR ws2812_writergb(lua_State* L)
|
||||||
platform_gpio_write(pin, 0);
|
platform_gpio_write(pin, 0);
|
||||||
|
|
||||||
// Send the buffer
|
// Send the buffer
|
||||||
os_intr_lock();
|
ets_intr_lock();
|
||||||
ws2812_write(pin_num[pin], (uint8_t*) buffer, length);
|
ws2812_write(pin_num[pin], (uint8_t*) buffer, length);
|
||||||
os_intr_unlock();
|
ets_intr_unlock();
|
||||||
|
|
||||||
c_free(buffer);
|
c_free(buffer);
|
||||||
|
|
||||||
|
@ -120,9 +120,9 @@ static int ICACHE_FLASH_ATTR ws2812_writegrb(lua_State* L) {
|
||||||
platform_gpio_write(pin, 0);
|
platform_gpio_write(pin, 0);
|
||||||
|
|
||||||
// Send the buffer
|
// Send the buffer
|
||||||
os_intr_lock();
|
ets_intr_lock();
|
||||||
ws2812_write(pin_num[pin], (uint8_t*) buffer, length);
|
ws2812_write(pin_num[pin], (uint8_t*) buffer, length);
|
||||||
os_intr_unlock();
|
ets_intr_unlock();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue