Skip to content

Commit

Permalink
Updated 'ethernet' module
Browse files Browse the repository at this point in the history
  updated all modules using network to work on any network interface, including ethernet
  ftpserver and telnet server now also works over ethernet

Updated 'uos.sdconfig()'
  SPI host can be selected if SDCard mode is SPI

Updated 'Curl' module
  added 'getmail' method
  added option to set maximum write buffer size, lower size can make it more usable on boards without psRAM
  tab character (0x09) is now accepted in response body

Updated 'machine' module
  fixed bug in 'deepsleep' method, deepslep for all timeout values now works as expected

Updated 'DAC' module
  fixed bug in 'waveform' method, the 'duration' argument now works for waveform types

Updated 'machine.Pin' module
  fixed bug in handling the 'debounce' argument

Added 'requests' module implemented in C, based on 'esp_http_client' componnent
  get, post, head, put, patch methods

Refactored 'display' module
  added full support for FTDI EVE chips (FT8xx)
  prepared for implementation of e-paper displays support

Updated sdcard support

Updated esp-idf to version v3.1-rc1-53509c7b
  • Loading branch information
loboris committed Aug 27, 2018
1 parent 210efe9 commit 073ba4e
Show file tree
Hide file tree
Showing 93 changed files with 9,652 additions and 2,699 deletions.
4 changes: 2 additions & 2 deletions MicroPython_BUILD/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1072481106224612254" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1072297972298084254" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
6 changes: 4 additions & 2 deletions MicroPython_BUILD/BUILD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
# size - display static memory footprint of the firmware
# size-components - display detailed memory footprint of the firmware
# size-files - display detailed memory footprint of the firmware
# miniterm - start pySerial command line program miniterm
# monitor - start esp-idf terminal emulator

# Options:
# -jN - make with multicore option, N should be the number of cores used
Expand All @@ -50,8 +52,8 @@


#=======================
TOOLS_VER=ver20180628.id
BUILD_VER=ver20180628.id
TOOLS_VER=ver20180827.id
BUILD_VER=ver20180827.id
#=======================

# -----------------------------
Expand Down
7 changes: 7 additions & 0 deletions MicroPython_BUILD/build_func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,13 @@ executeCommand() {
echo "======================"
make erase_flash${BUILD_COMPORT}${BUILD_BDRATE}

# ------------------------------------
elif [ "${arg}" == "miniterm" ]; then
echo "====================="
echo "Executing miniterm..."
echo "====================="
make simple_monitor${BUILD_COMPORT}

# ----------------------------------
elif [ "${arg}" == "monitor" ]; then
echo "============================"
Expand Down
8 changes: 7 additions & 1 deletion MicroPython_BUILD/components/curl/include/curl/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* https://cool.haxx.se/mailman/listinfo/curl-library/
*/

#include "sdkconfig.h"

#define SIZEOF_CURL_OFF_T 4

#ifdef CURL_NO_OLDIES
Expand Down Expand Up @@ -218,7 +220,7 @@ typedef int (*curl_xferinfo_callback)(void *clientp,

#ifndef CURL_MAX_READ_SIZE
/* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
#define CURL_MAX_READ_SIZE 524288
#define CURL_MAX_READ_SIZE 16384
#endif

#ifndef CURL_MAX_WRITE_SIZE
Expand All @@ -228,8 +230,12 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
time for those who feel adventurous. The practical minimum is about
400 bytes since libcurl uses a buffer of this size as a scratch area
(unrelated to network send operations). */
#ifdef CONFIG_MICROPY_CURL_MAX_WRITE_SIZE
#define CURL_MAX_WRITE_SIZE CONFIG_MICROPY_CURL_MAX_WRITE_SIZE
#else
#define CURL_MAX_WRITE_SIZE 16384
#endif
#endif

#ifndef CURL_MAX_HTTP_HEADER
/* The only reason to have a max limit for this is to avoid the risk of a bad
Expand Down
10 changes: 6 additions & 4 deletions MicroPython_BUILD/components/curl/lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,11 +1409,13 @@ void Curl_conncontrol(struct connectdata *conn,
bool closeit = (ctrl == CONNCTRL_CONNECTION) ||
((ctrl == CONNCTRL_STREAM) && !(conn->handler->flags & PROTOPT_STREAM));
if((ctrl == CONNCTRL_STREAM) &&
(conn->handler->flags & PROTOPT_STREAM))
DEBUGF(infof(conn->data, "Kill stream: %s\n", reason));
(conn->handler->flags & PROTOPT_STREAM)) {
//DEBUGF(infof(conn->data, "Kill stream: %s\n", reason));
DEBUGF(infof(conn->data, "Kill stream\n"));
}
else if(closeit != conn->bits.close) {
DEBUGF(infof(conn->data, "Marked for [%s]: %s\n",
closeit?"closure":"keep alive", reason));
//DEBUGF(infof(conn->data, "Marked for [%s]: %s\n", closeit?"closure":"keep alive", reason));
DEBUGF(infof(conn->data, "Marked for [%s]\n", closeit?"closure":"keep alive"));
conn->bits.close = closeit; /* the only place in the source code that
should assign this bit */
}
Expand Down
83 changes: 79 additions & 4 deletions MicroPython_BUILD/components/micropython/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,73 @@ menu "MicroPython"
default n
help
Include Display module into build
Display module includes support for various SPI TFT displays

config MICROPY_USE_TFT
depends on MICROPY_USE_DISPLAY
bool "Enable support for SPI TFT displays"
default y
help
Include support for various SPI TFT displays

config MICROPY_USE_EPD
depends on MICROPY_USE_DISPLAY
bool "Enable support for ePaper displays (NOT COMPLETE, DO NOT ENABLE)"
default n
help
Include support for ePaper displays into build

config MICROPY_USE_EVE
bool "Use EVE display module (experimental, do not enable)"
depends on MICROPY_USE_DISPLAY
bool "Enable support for EVE (FT8xx) displays"
default n
help
Include EVE display module into build
Display module includes support for EVE displays (FT80x, FT81x)
Includes support for EVE displays (FT80x, FT81x)

menu "EVE Configuration"
depends on MICROPY_USE_EVE
config MICROPY_EVE_FT81X
bool "EVE FT81X type"
depends on MICROPY_USE_EVE
default y
help
Used FT8xx chip is FT81x
If not set, the code for FT80x will be compiled

config EVE_MODE_TYPE
int
default 0 if FT8_USER_TYPE
default 1 if FT8_FT810CB_HY50HD
default 2 if FT8_FT811CB_HY50HD
default 3 if FT8_VM800B35A
default 4 if FT8_VM800B43A
default 5 if FT8_VM800B50A
default 6 if FT8_EVE2_50G
default 6 if FT8_EVE2_TEST

choice
prompt "Select predefined EVE display type"
default EVE_MODE_TYPE1
help
Select predefined EVE display type

config FT8_USER_TYPE
bool "User defined"
config FT8_FT810CB_HY50HD
bool "FT810CB-HY50HD: FT810 800x480 5\", HAOYU"
config FT8_FT811CB_HY50HD
bool "FT811CB-HY50HD: FT810 800x480 5\", HAOYU"
config FT8_VM800B35A
bool "VM800B35A: FT800 320x240 3.5\", FTDI"
config FT8_VM800B43A
bool "VM800B43A: FT800 480x272 4.4\", FTDI/BRT"
config FT8_VM800B50A
bool "VM800B50A: FT800 480x272 5\", FTDI/BRT"
config FT8_EVE2_50G
bool "800x480 5.0\" capacitive touch, FT813"
config FT8_EVE2_TEST
bool "TEST display"
endchoice
endmenu

config MICROPY_USE_GSM
bool "Use GSM module"
Expand Down Expand Up @@ -384,13 +443,29 @@ menu "MicroPython"
help
Include mDNS module into build

config MICROPY_USE_REQUESTS
bool "Use requests module"
default y
help
Include requests module into build
The module ofers less features than curl, but uses far les resources

config MICROPY_USE_CURL
bool "Use Curl module"
default n
help
Include CURL module into build
Using CURL module will add ~230 KB to your flash code size

config MICROPY_CURL_MAX_WRITE_SIZE
int "Curl max write buffer size"
depends on MICROPY_USE_CURL
range 1024 16384
default 8192
help
Curl buffer size used in many Curl functions
If not using SPIRAM, it may be necessary to set the size to the lower value

config MICROPY_USE_CURL_TLS
bool "Enable TLS in Curl module"
depends on MICROPY_USE_CURL
Expand Down
6 changes: 4 additions & 2 deletions MicroPython_BUILD/components/micropython/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ LIBS_SRC_C = $(addprefix esp32/libs/,\
littleflash.c \
)

ifdef CONFIG_MICROPY_USE_DISPLAY
ifdef CONFIG_MICROPY_USE_TFT
LIBS_SRC_C += \
esp32/moddisplay_tft.c \
esp32/libs/tft/tftspi.c \
esp32/libs/tft/tft.c \
esp32/libs/tft/comic24.c \
Expand All @@ -278,7 +279,8 @@ endif

ifdef CONFIG_MICROPY_USE_EVE
LIBS_SRC_C += \
esp32/libs/eve/FT8_commands.c
esp32/libs/eve/FT8_commands.c \
esp32/moddisplay_eve.c
endif

ifeq ($(MICROPY_PY_BTREE),1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ const char* curlmail_protocol_send(curl_mail mail_object, const char* smtpserver
if (curl_progress) curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L);

curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, 2048);

//send the message
MP_THREAD_GIL_EXIT();
result = curl_easy_perform(curl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ extern "C" {

#define CURLMAIL_PROTOCOL_SMTP 1
#define CURLMAIL_PROTOCOL_SMTPS 2
#define CURLMAIL_PROTOCOL_IMAP 3
#define CURLMAIL_PROTOCOL_IMAPS 4

#define CURLMAIL_MAX_ATTACHMENTS 4


Expand Down
Loading

0 comments on commit 073ba4e

Please sign in to comment.