Merge remote-tracking branch 'upstream/master'
Conflicts: core/newlib_syscalls.c
This commit is contained in:
commit
8f6c297849
35 changed files with 452 additions and 307 deletions
|
|
@ -3,7 +3,7 @@
|
|||
* This sample code is in the public domain.
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "esp8266.h"
|
||||
|
|
@ -53,7 +53,7 @@ void blinkenRegisterTask(void *pvParameters)
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
xTaskCreate(blinkenTask, (signed char *)"blinkenTask", 256, NULL, 2, NULL);
|
||||
//xTaskCreate(blinkenRegisterTask, (signed char *)"blinkenRegisterTask", 256, NULL, 2, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* This sample code is in the public domain.
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "esp8266.h"
|
||||
|
|
@ -33,7 +33,7 @@ void frc2_interrupt_handler(void)
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
/* configure GPIOs */
|
||||
gpio_enable(gpio_frc1, GPIO_OUTPUT);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* This sample code is in the public domain.
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
|
@ -87,7 +87,7 @@ void bmp180_task(void *pvParameters)
|
|||
void user_setup(void)
|
||||
{
|
||||
// Set UART Parameter
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
// Give the UART some time to settle
|
||||
sdk_os_delay_us(500);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* This sample code is in the public domain.
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
|
|
@ -75,7 +75,7 @@ void GPIO_HANDLER(void)
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
gpio_enable(gpio, GPIO_INPUT);
|
||||
|
||||
tsqueue = xQueueCreate(2, sizeof(uint32_t));
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
#include "espressif/esp_common.h"
|
||||
|
||||
#include "esp/uart.h"
|
||||
|
||||
/******************************************************************************************************************
|
||||
* task_1_t
|
||||
*
|
||||
|
|
@ -94,8 +96,8 @@ esp_open_rtos::thread::queue_t<uint32_t> MyQueue;
|
|||
*/
|
||||
extern "C" void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
MyQueue.queue_create(10);
|
||||
|
||||
task_1.queue = MyQueue;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* This experimental reverse engineering code is in the public domain.
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "esp8266.h"
|
||||
|
|
@ -118,7 +118,7 @@ void frc2_handler(void)
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
xTaskCreate(timerRegTask, (signed char *)"timerRegTask", 1024, NULL, 2, NULL);
|
||||
|
||||
TIMER(0).CTRL = VAL2FIELD(TIMER_CTRL_CLKDIV, TIMER_CLKDIV_256) | TIMER_CTRL_RELOAD;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "esp/rom.h"
|
||||
#include "esp/timer.h"
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
|
|
@ -214,7 +214,7 @@ void sanity_tests(void);
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
gpio_enable(2, GPIO_OUTPUT); /* used for LED debug */
|
||||
gpio_write(2, 1); /* active low */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* This sample code is in the public domain.,
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ void http_get_task(void *pvParameters)
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
printf("SDK version:%s\n", sdk_system_get_sdk_version());
|
||||
|
||||
struct sdk_station_config config = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Additions Copyright (C) 2015 Angus Gratton, Apache 2.0 License.
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -80,7 +80,6 @@ static void my_debug(void *ctx, int level,
|
|||
file = file_sep+1;
|
||||
|
||||
printf("%s:%04d: %s", file, line, str);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -107,7 +106,6 @@ void http_get_task(void *pvParameters)
|
|||
mbedtls_x509_crt_init(&cacert);
|
||||
mbedtls_ctr_drbg_init(&ctr_drbg);
|
||||
printf("\n . Seeding the random number generator...");
|
||||
fflush(stdout);
|
||||
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
|
||||
|
|
@ -126,7 +124,6 @@ void http_get_task(void *pvParameters)
|
|||
* 0. Initialize certificates
|
||||
*/
|
||||
printf(" . Loading the CA root certificate ...");
|
||||
fflush(stdout);
|
||||
|
||||
ret = mbedtls_x509_crt_parse(&cacert, (uint8_t*)server_root_cert, strlen(server_root_cert)+1);
|
||||
if(ret < 0)
|
||||
|
|
@ -148,7 +145,6 @@ void http_get_task(void *pvParameters)
|
|||
* 2. Setup stuff
|
||||
*/
|
||||
printf(" . Setting up the SSL/TLS structure...");
|
||||
fflush(stdout);
|
||||
|
||||
if((ret = mbedtls_ssl_config_defaults(&conf,
|
||||
MBEDTLS_SSL_IS_CLIENT,
|
||||
|
|
@ -182,7 +178,6 @@ void http_get_task(void *pvParameters)
|
|||
our network is probably working...
|
||||
*/
|
||||
printf("Waiting for server DNS to resolve... ");
|
||||
fflush(stdout);
|
||||
err_t dns_err;
|
||||
ip_addr_t host_ip;
|
||||
do {
|
||||
|
|
@ -198,7 +193,6 @@ void http_get_task(void *pvParameters)
|
|||
* 1. Start the connection
|
||||
*/
|
||||
printf(" . Connecting to %s:%s...", WEB_SERVER, WEB_PORT);
|
||||
fflush(stdout);
|
||||
|
||||
if((ret = mbedtls_net_connect(&server_fd, WEB_SERVER,
|
||||
WEB_PORT, MBEDTLS_NET_PROTO_TCP)) != 0)
|
||||
|
|
@ -215,7 +209,6 @@ void http_get_task(void *pvParameters)
|
|||
* 4. Handshake
|
||||
*/
|
||||
printf(" . Performing the SSL/TLS handshake...");
|
||||
fflush(stdout);
|
||||
|
||||
while((ret = mbedtls_ssl_handshake(&ssl)) != 0)
|
||||
{
|
||||
|
|
@ -251,7 +244,6 @@ void http_get_task(void *pvParameters)
|
|||
* 3. Write the GET request
|
||||
*/
|
||||
printf(" > Write to server:");
|
||||
fflush(stdout);
|
||||
|
||||
int len = sprintf((char *) buf, GET_REQUEST);
|
||||
|
||||
|
|
@ -271,7 +263,6 @@ void http_get_task(void *pvParameters)
|
|||
* 7. Read the HTTP response
|
||||
*/
|
||||
printf(" < Read from server:");
|
||||
fflush(stdout);
|
||||
|
||||
do
|
||||
{
|
||||
|
|
@ -322,7 +313,6 @@ void http_get_task(void *pvParameters)
|
|||
printf("\n\nsuccesses = %d failures = %d\n", successes, failures);
|
||||
for(int countdown = successes ? 10 : 5; countdown >= 0; countdown--) {
|
||||
printf("%d... ", countdown);
|
||||
fflush(stdout);
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
}
|
||||
printf("\nStarting again!\n");
|
||||
|
|
@ -331,7 +321,7 @@ void http_get_task(void *pvParameters)
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
printf("SDK version:%s\n", sdk_system_get_sdk_version());
|
||||
|
||||
struct sdk_station_config config = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* NOT SUITABLE TO PUT ON THE INTERNET OR INTO A PRODUCTION ENVIRONMENT!!!!
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "esp8266.h"
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
rboot_config_t conf = rboot_get_config();
|
||||
printf("\r\n\r\nOTA Basic demo.\r\nCurrently running on flash slot %d / %d.\r\n\r\n",
|
||||
|
|
|
|||
3
examples/serial_echo/Makefile
Normal file
3
examples/serial_echo/Makefile
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Simple makefile for serial_echo example
|
||||
PROGRAM=serial_echo
|
||||
include ../../common.mk
|
||||
42
examples/serial_echo/serial_echo.c
Normal file
42
examples/serial_echo/serial_echo.c
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* Extremely simple example that just reads from stdin and echoes back on stdout
|
||||
*
|
||||
* Has an easter egg, which is if you type "QUACK" it'll quack 3 times back at you.
|
||||
*
|
||||
* This example code is in the public domain
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include <esp/uart.h>
|
||||
#include <string.h>
|
||||
|
||||
void user_init(void)
|
||||
{
|
||||
uart_set_baud(0, 115200);
|
||||
printf("SDK version:%s\n", sdk_system_get_sdk_version());
|
||||
printf("Going into echo mode...\n");
|
||||
|
||||
/* By default stdout is line-buffered, so you only see output
|
||||
after a newline is sent. This is helpful in a multithreaded
|
||||
environment so output doesn't get chopped up within a line.
|
||||
|
||||
Here we want to see the echo immediately, so disable buffering.
|
||||
*/
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
while(1) {
|
||||
int c = getchar();
|
||||
if(c != EOF)
|
||||
putchar(c);
|
||||
|
||||
/* Easter egg: check for a quack! */
|
||||
static int quack;
|
||||
if(c == "QUACK"[quack]) {
|
||||
quack++;
|
||||
if(quack == strlen("QUACK")) {
|
||||
printf("\nQUACK\nQUACK\n");
|
||||
quack = 0;
|
||||
}
|
||||
} else {
|
||||
quack = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/* Very basic example that just demonstrates we can run at all!
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
|
|
@ -36,7 +36,7 @@ static xQueueHandle mainqueue;
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
printf("SDK version:%s\n", sdk_system_get_sdk_version());
|
||||
mainqueue = xQueueCreate(10, sizeof(uint32_t));
|
||||
xTaskCreate(task1, (signed char *)"tsk1", 256, &mainqueue, 2, NULL);
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@
|
|||
This sample code is in the public domain.
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
|
||||
#include <esp/uart.h>
|
||||
|
||||
class Counter
|
||||
{
|
||||
private:
|
||||
|
|
@ -58,7 +59,7 @@ void task1(void *pvParameters)
|
|||
|
||||
extern "C" void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
printf("SDK version:%s\n", sdk_system_get_sdk_version());
|
||||
xTaskCreate(task1, (signed char *)"tsk1", 256, NULL, 2, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* This sample code is in the public domain.,
|
||||
*/
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
#include "esp/uart.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "mbedtls/md.h"
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ static void test_md5(void)
|
|||
|
||||
void user_init(void)
|
||||
{
|
||||
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200);
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
test_md5();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue