Explorar el Código

Changed os_intr_xxx to ets_intr_xxx.

The os_intr_xxx macros no longer exist in the SDK.
Johny Mattsson hace 8 años
padre
commit
d2ac5f1712
Se han modificado 5 ficheros con 14 adiciones y 14 borrados
  1. 3 3
      app/dhtlib/dht.c
  2. 2 2
      app/driver/onewire.c
  3. 3 3
      app/modules/gpio.c
  4. 2 2
      app/modules/ws2801.c
  5. 4 4
      app/modules/ws2812.c

+ 3 - 3
app/dhtlib/dht.c

@@ -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
-//
+//

+ 2 - 2
app/driver/onewire.c

@@ -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

+ 3 - 3
app/modules/gpio.c

@@ -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] )

+ 2 - 2
app/modules/ws2801.c

@@ -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;
 }

+ 4 - 4
app/modules/ws2812.c

@@ -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;
 }