Changed os_intr_xxx to ets_intr_xxx.

The os_intr_xxx macros no longer exist in the SDK.
This commit is contained in:
Johny Mattsson 2015-10-01 15:19:50 +10:00
parent 3b9a42e254
commit d2ac5f1712
5 changed files with 14 additions and 14 deletions

View File

@ -253,7 +253,7 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
// delay(wakeupDelay);
for (i = 0; i < wakeupDelay; i++) os_delay_us(1000);
// Disable interrupts
os_intr_lock();
ets_intr_lock();
// digitalWrite(pin, HIGH); // T-go
DIRECT_WRITE_HIGH(pin);
os_delay_us(40);
@ -306,7 +306,7 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
}
}
// Enable interrupts
os_intr_unlock();
ets_intr_unlock();
// pinMode(pin, OUTPUT);
DIRECT_MODE_OUTPUT(pin);
// digitalWrite(pin, HIGH);
@ -316,4 +316,4 @@ int dht_readSensor(uint8_t pin, uint8_t wakeupDelay)
}
//
// END OF FILE
//
//

View File

@ -60,8 +60,8 @@ sample code bearing this copyright.
#include "platform.h"
#include "osapi.h"
#define noInterrupts os_intr_lock
#define interrupts os_intr_unlock
#define noInterrupts ets_intr_lock
#define interrupts ets_intr_unlock
#define delayMicroseconds os_delay_us
// 1 for keeping the parasitic power on H

View File

@ -64,7 +64,7 @@ static int lgpio_trig( lua_State* L )
}else if(sl == 4 && c_strcmp(str, "down") == 0){
type = GPIO_PIN_INTR_NEGEDGE;
}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){
type = GPIO_PIN_INTR_LOLEVEL;
}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 noInterrupts os_intr_lock
#define interrupts os_intr_unlock
#define noInterrupts ets_intr_lock
#define interrupts ets_intr_unlock
#define delayMicroseconds os_delay_us
#define DIRECT_WRITE(pin, level) (GPIO_OUTPUT_SET(GPIO_ID_PIN(pin_num[pin]), level))
// Lua: serout( pin, firstLevel, delay_table, [repeatNum] )

View File

@ -115,11 +115,11 @@ static int ICACHE_FLASH_ATTR ws2801_writergb(lua_State* L) {
os_delay_us(10);
os_intr_lock();
ets_intr_lock();
ws2801_strip(buffer, length);
os_intr_unlock();
ets_intr_unlock();
return 0;
}

View File

@ -94,9 +94,9 @@ static int ICACHE_FLASH_ATTR ws2812_writergb(lua_State* L)
platform_gpio_write(pin, 0);
// Send the buffer
os_intr_lock();
ets_intr_lock();
ws2812_write(pin_num[pin], (uint8_t*) buffer, length);
os_intr_unlock();
ets_intr_unlock();
c_free(buffer);
@ -120,9 +120,9 @@ static int ICACHE_FLASH_ATTR ws2812_writegrb(lua_State* L) {
platform_gpio_write(pin, 0);
// Send the buffer
os_intr_lock();
ets_intr_lock();
ws2812_write(pin_num[pin], (uint8_t*) buffer, length);
os_intr_unlock();
ets_intr_unlock();
return 0;
}