-
-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from anakod/master
Merge upstream changes.
- Loading branch information
Showing
15 changed files
with
1,711 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
##################################################################### | ||
#### Please don't change this file. Use Makefile-user.mk instead #### | ||
##################################################################### | ||
# Including user Makefile. | ||
# Should be used to set project-specific parameters | ||
include ./Makefile-user.mk | ||
|
||
# Important parameters check. | ||
# We need to make sure SMING_HOME and ESP_HOME variables are set. | ||
# You can use Makefile-user.mk in each project or use enviromental variables to set it globally. | ||
|
||
ifndef SMING_HOME | ||
$(error SMING_HOME is not set. Please configure it in Makefile-user.mk) | ||
endif | ||
ifndef ESP_HOME | ||
$(error ESP_HOME is not set. Please configure it in Makefile-user.mk) | ||
endif | ||
|
||
# Include main Sming Makefile | ||
include $(SMING_HOME)/Makefile-project.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Local build configuration | ||
## Parameters configured here will override default and ENV values. | ||
## Uncomment and change examples: | ||
|
||
#Add your source directories here separated by space | ||
MODULES = app | ||
|
||
## ESP_HOME sets the path where ESP tools and SDK are located. | ||
## Windows: | ||
# ESP_HOME = c:/Espressif | ||
|
||
## MacOS / Linux: | ||
#ESP_HOME = /opt/esp-open-sdk | ||
|
||
## SMING_HOME sets the path where Sming framework is located. | ||
## Windows: | ||
# SMING_HOME = c:/tools/sming/Sming | ||
|
||
# MacOS / Linux | ||
# SMING_HOME = /opt/sming/Sming | ||
|
||
## COM port parameter is reqruied to flash firmware correctly. | ||
## Windows: | ||
# COM_PORT = COM3 | ||
|
||
# MacOS / Linux: | ||
# COM_PORT = /dev/tty.usbserial | ||
|
||
# Com port speed | ||
# COM_SPEED = 115200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*************************************************** | ||
A simple example on how to use the IR library | ||
****************************************************/ | ||
|
||
#include <user_config.h> | ||
#include <SmingCore/SmingCore.h> | ||
#include <Libraries/IR/IRremote.h> | ||
#include <Libraries/IR/IRremoteInt.h> | ||
|
||
#define IR_PIN 12 // GPIO12 | ||
|
||
Timer irTimer; | ||
decode_results dresults; | ||
IRrecv irrecv(IR_PIN); | ||
IRsend irsend; | ||
|
||
void receiveIR() | ||
{ | ||
if(irrecv.decode(&dresults)==DECODED){ | ||
irTimer.stop(); | ||
unsigned int * sendbuff = new unsigned int[dresults.rawlen-1]; | ||
for(int i=0; i<dresults.rawlen-1; i++){ | ||
sendbuff[i]=dresults.rawbuf[i+1]*50; | ||
} | ||
irsend.sendNEC(dresults.value, dresults.bits); | ||
Serial.println("Sent IR Code"); | ||
irrecv.enableIRIn(); | ||
irTimer.start(); | ||
} | ||
} | ||
|
||
void init() | ||
{ | ||
Serial.begin(SERIAL_BAUD_RATE); // 115200 by default | ||
Serial.println("Setting up..."); | ||
irrecv.blink13(1); | ||
irrecv.enableIRIn(); // Start the receiver | ||
irTimer.initializeMs(1000, receiveIR).start(); | ||
Serial.println("Ready..."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef __USER_CONFIG_H__ | ||
#define __USER_CONFIG_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
// UART config | ||
#define SERIAL_BAUD_RATE 115200 | ||
|
||
// ESP SDK config | ||
#define LWIP_OPEN_SRC | ||
#define USE_US_TIMER | ||
|
||
// Default types | ||
#define __CORRECT_ISO_CPP_STDLIB_H_PROTO | ||
#include <limits.h> | ||
#include <stdint.h> | ||
|
||
// Override c_types.h include and remove buggy espconn | ||
#define _C_TYPES_H_ | ||
#define _NO_ESPCON_ | ||
|
||
// Updated, compatible version of c_types.h | ||
// Just removed types declared in <stdint.h> | ||
#include <espinc/c_types_compatible.h> | ||
|
||
// System API declarations | ||
#include <esp_systemapi.h> | ||
|
||
// C++ Support | ||
#include <esp_cplusplus.h> | ||
// Extended string conversion for compatibility | ||
#include <stringconversion.h> | ||
// Network base API | ||
#include <espinc/lwip_includes.h> | ||
|
||
// Beta boards | ||
#define BOARD_ESP01 | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.