From ffd6c1594785b1c3ae08943f3971b11c6a7d5e80 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 18 May 2015 20:06:24 +0300 Subject: [PATCH 1/3] Make platform.txt compatible with board manager package --- platform.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/platform.txt b/platform.txt index a408813f4..a776b7e9c 100644 --- a/platform.txt +++ b/platform.txt @@ -6,12 +6,15 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=ESP8266 Modules -version=1.6.1 +version=1.6.4 -compiler.tools.path={runtime.platform.path}/tools/ -compiler.path={compiler.tools.path}xtensa-lx106-elf/bin/ -compiler.sdk.path={compiler.tools.path}sdk/ +#board-manager-package-compat-begin +runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf-gcc +runtime.tools.esptool.path={runtime.platform.path}/tools +#board-manager-package-compat-end +compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/ +compiler.sdk.path={runtime.platform.path}/tools/sdk/ compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" compiler.c.cmd=xtensa-lx106-elf-gcc @@ -33,7 +36,6 @@ compiler.ar.cmd=xtensa-lx106-elf-ar compiler.ar.flags=cru compiler.elf2hex.cmd=esptool - compiler.elf2hex.flags= compiler.size.cmd=xtensa-lx106-elf-size @@ -74,7 +76,7 @@ recipe.objcopy.eep.pattern= ## Create hex #recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" -recipe.objcopy.hex.pattern="{compiler.tools.path}{compiler.esptool.cmd}" -eo "{build.path}/{build.project_name}.elf" -bo "{build.path}/{build.project_name}_00000.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bs .data -bs .rodata -bc -ec -eo "{build.path}/{build.project_name}.elf" -es .irom0.text "{build.path}/{build.project_name}_10000.bin" -ec +recipe.objcopy.hex.pattern="{runtime.tools.esptool.path}/{compiler.esptool.cmd}" -eo "{build.path}/{build.project_name}.elf" -bo "{build.path}/{build.project_name}_00000.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bs .data -bs .rodata -bc -ec -eo "{build.path}/{build.project_name}.elf" -es .irom0.text "{build.path}/{build.project_name}_10000.bin" -ec ## Compute size recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" @@ -86,9 +88,8 @@ recipe.size.regex=^(?:\.text|\.data|\.rodata|\.irom0\.text|)\s+([0-9]+).* tools.esptool.cmd=esptool tools.esptool.cmd.windows=esptool.exe -tools.esptool.path={runtime.platform.path}/tools tools.esptool.upload.protocol=esp tools.esptool.upload.params.verbose=-vv tools.esptool.upload.params.quiet= -tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin" +tools.esptool.upload.pattern="{runtime.tools.esptool.path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin" From 3540c150283ee30576ffc05c24428839c6278ea8 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 18 May 2015 21:52:15 +0300 Subject: [PATCH 2/3] Fix tools path --- platform.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform.txt b/platform.txt index a776b7e9c..c2cfa053e 100644 --- a/platform.txt +++ b/platform.txt @@ -8,10 +8,8 @@ name=ESP8266 Modules version=1.6.4 -#board-manager-package-compat-begin -runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf-gcc +runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf runtime.tools.esptool.path={runtime.platform.path}/tools -#board-manager-package-compat-end compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/ compiler.sdk.path={runtime.platform.path}/tools/sdk/ @@ -88,8 +86,9 @@ recipe.size.regex=^(?:\.text|\.data|\.rodata|\.irom0\.text|)\s+([0-9]+).* tools.esptool.cmd=esptool tools.esptool.cmd.windows=esptool.exe +tools.esptool.path={runtime.platform.path}/tools tools.esptool.upload.protocol=esp tools.esptool.upload.params.verbose=-vv tools.esptool.upload.params.quiet= -tools.esptool.upload.pattern="{runtime.tools.esptool.path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin" +tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin" From d4d4beb0d5f07c7a925885eb34deb1245df9d3db Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 18 May 2015 22:52:14 +0300 Subject: [PATCH 3/3] Fix issue with min/max fix #263 --- cores/esp8266/Arduino.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cores/esp8266/Arduino.h b/cores/esp8266/Arduino.h index dbc003b1d..767ea4f28 100644 --- a/cores/esp8266/Arduino.h +++ b/cores/esp8266/Arduino.h @@ -112,8 +112,6 @@ void timer1_write(uint32_t ticks); //maximum ticks 8388607 #undef abs #endif -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) #define abs(x) ((x)>0?(x):-(x)) #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) @@ -215,6 +213,9 @@ void loop(void); #include "Esp.h" #include "debug.h" +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) + uint16_t makeWord(uint16_t w); uint16_t makeWord(byte h, byte l);