Change default baud rate back to 74906bps, compatible with boot ROM rate

This reverts a behaviour change from 3ceadfc0a6.
This commit is contained in:
Angus Gratton 2015-10-06 23:04:19 +11:00
parent 9c1307c5d1
commit 7d67bf2ede
15 changed files with 48 additions and 7 deletions

View file

@ -278,8 +278,8 @@ static void init_networking(uint8_t *phy_info, uint8_t *mac_addr) {
printf("FATAL: sdk_register_chipv6_phy failed"); printf("FATAL: sdk_register_chipv6_phy failed");
halt(); halt();
} }
uart_set_baud(0, 115200); uart_set_baud(0, 74906);
uart_set_baud(1, 115200); uart_set_baud(1, 74906);
sdk_phy_disable_agc(); sdk_phy_disable_agc();
sdk_ieee80211_phy_init(sdk_g_ic.s.phy_mode); sdk_ieee80211_phy_init(sdk_g_ic.s.phy_mode);
sdk_lmacInit(); sdk_lmacInit();

View file

@ -3,6 +3,7 @@
* This sample code is in the public domain. * This sample code is in the public domain.
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "esp8266.h" #include "esp8266.h"
@ -52,6 +53,7 @@ void blinkenRegisterTask(void *pvParameters)
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
xTaskCreate(blinkenTask, (signed char *)"blinkenTask", 256, NULL, 2, NULL); xTaskCreate(blinkenTask, (signed char *)"blinkenTask", 256, NULL, 2, NULL);
//xTaskCreate(blinkenRegisterTask, (signed char *)"blinkenRegisterTask", 256, NULL, 2, NULL); //xTaskCreate(blinkenRegisterTask, (signed char *)"blinkenRegisterTask", 256, NULL, 2, NULL);
} }

View file

@ -3,6 +3,7 @@
* This sample code is in the public domain. * This sample code is in the public domain.
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "esp8266.h" #include "esp8266.h"
@ -32,6 +33,8 @@ void frc2_interrupt_handler(void)
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
/* configure GPIOs */ /* configure GPIOs */
gpio_enable(gpio_frc1, GPIO_OUTPUT); gpio_enable(gpio_frc1, GPIO_OUTPUT);
gpio_enable(gpio_frc2, GPIO_OUTPUT); gpio_enable(gpio_frc2, GPIO_OUTPUT);

View file

@ -3,6 +3,7 @@
* This sample code is in the public domain. * This sample code is in the public domain.
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
@ -82,9 +83,22 @@ void bmp180_task(void *pvParameters)
} }
} }
// Setup HW
void user_setup(void)
{
// Set UART Parameter
uart_set_baud(0, 115200);
// Give the UART some time to settle
sdk_os_delay_us(500);
}
void user_init(void) void user_init(void)
{ {
// Just some informations // Setup HW
user_setup();
// Just some infomations
printf("\n"); printf("\n");
printf("SDK version : %s\n", sdk_system_get_sdk_version()); printf("SDK version : %s\n", sdk_system_get_sdk_version());
printf("GIT version : %s\n", GITSHORTREV); printf("GIT version : %s\n", GITSHORTREV);

View file

@ -6,6 +6,7 @@
* This sample code is in the public domain. * This sample code is in the public domain.
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "queue.h" #include "queue.h"
@ -74,6 +75,7 @@ void GPIO_HANDLER(void)
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
gpio_enable(gpio, GPIO_INPUT); gpio_enable(gpio, GPIO_INPUT);
tsqueue = xQueueCreate(2, sizeof(uint32_t)); tsqueue = xQueueCreate(2, sizeof(uint32_t));

View file

@ -31,6 +31,8 @@
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
/****************************************************************************************************************** /******************************************************************************************************************
* task_1_t * task_1_t
* *
@ -94,6 +96,8 @@ esp_open_rtos::thread::queue_t<uint32_t> MyQueue;
*/ */
extern "C" void user_init(void) extern "C" void user_init(void)
{ {
uart_set_baud(0, 115200);
MyQueue.queue_create(10); MyQueue.queue_create(10);
task_1.queue = MyQueue; task_1.queue = MyQueue;

View file

@ -7,6 +7,7 @@
* This experimental reverse engineering code is in the public domain. * This experimental reverse engineering code is in the public domain.
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "esp8266.h" #include "esp8266.h"
@ -117,6 +118,7 @@ void frc2_handler(void)
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
xTaskCreate(timerRegTask, (signed char *)"timerRegTask", 1024, NULL, 2, NULL); xTaskCreate(timerRegTask, (signed char *)"timerRegTask", 1024, NULL, 2, NULL);
TIMER(0).CTRL = VAL2FIELD(TIMER_CTRL_CLKDIV, TIMER_CLKDIV_256) | TIMER_CTRL_RELOAD; TIMER(0).CTRL = VAL2FIELD(TIMER_CTRL_CLKDIV, TIMER_CLKDIV_256) | TIMER_CTRL_RELOAD;

View file

@ -3,6 +3,7 @@
#include "esp/rom.h" #include "esp/rom.h"
#include "esp/timer.h" #include "esp/timer.h"
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "queue.h" #include "queue.h"
@ -213,6 +214,8 @@ void sanity_tests(void);
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
gpio_enable(2, GPIO_OUTPUT); /* used for LED debug */ gpio_enable(2, GPIO_OUTPUT); /* used for LED debug */
gpio_write(2, 1); /* active low */ gpio_write(2, 1); /* active low */

View file

@ -5,7 +5,7 @@
* This sample code is in the public domain., * This sample code is in the public domain.,
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "espressif/sdk_private.h" #include "esp/uart.h"
#include <string.h> #include <string.h>
@ -114,6 +114,7 @@ void http_get_task(void *pvParameters)
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
printf("SDK version:%s\n", sdk_system_get_sdk_version()); printf("SDK version:%s\n", sdk_system_get_sdk_version());
struct sdk_station_config config = { struct sdk_station_config config = {

View file

@ -10,7 +10,7 @@
* Additions Copyright (C) 2015 Angus Gratton, Apache 2.0 License. * Additions Copyright (C) 2015 Angus Gratton, Apache 2.0 License.
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "espressif/sdk_private.h" #include "esp/uart.h"
#include <string.h> #include <string.h>
@ -331,6 +331,7 @@ void http_get_task(void *pvParameters)
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
printf("SDK version:%s\n", sdk_system_get_sdk_version()); printf("SDK version:%s\n", sdk_system_get_sdk_version());
struct sdk_station_config config = { struct sdk_station_config config = {

View file

@ -7,6 +7,7 @@
* NOT SUITABLE TO PUT ON THE INTERNET OR INTO A PRODUCTION ENVIRONMENT!!!! * NOT SUITABLE TO PUT ON THE INTERNET OR INTO A PRODUCTION ENVIRONMENT!!!!
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "esp8266.h" #include "esp8266.h"
@ -17,6 +18,8 @@
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
rboot_config_t conf = rboot_get_config(); 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", printf("\r\n\r\nOTA Basic demo.\r\nCurrently running on flash slot %d / %d.\r\n\r\n",
conf.current_rom, conf.count); conf.current_rom, conf.count);

View file

@ -10,6 +10,7 @@
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
printf("SDK version:%s\n", sdk_system_get_sdk_version()); printf("SDK version:%s\n", sdk_system_get_sdk_version());
printf("Going into echo mode...\n"); printf("Going into echo mode...\n");

View file

@ -1,6 +1,7 @@
/* Very basic example that just demonstrates we can run at all! /* Very basic example that just demonstrates we can run at all!
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "queue.h" #include "queue.h"
@ -35,6 +36,7 @@ static xQueueHandle mainqueue;
void user_init(void) void user_init(void)
{ {
uart_set_baud(0, 115200);
printf("SDK version:%s\n", sdk_system_get_sdk_version()); printf("SDK version:%s\n", sdk_system_get_sdk_version());
mainqueue = xQueueCreate(10, sizeof(uint32_t)); mainqueue = xQueueCreate(10, sizeof(uint32_t));
xTaskCreate(task1, (signed char *)"tsk1", 256, &mainqueue, 2, NULL); xTaskCreate(task1, (signed char *)"tsk1", 256, &mainqueue, 2, NULL);

View file

@ -7,6 +7,8 @@
#include "task.h" #include "task.h"
#include "queue.h" #include "queue.h"
#include <esp/uart.h>
class Counter class Counter
{ {
private: private:
@ -57,6 +59,7 @@ void task1(void *pvParameters)
extern "C" void user_init(void) extern "C" void user_init(void)
{ {
uart_set_baud(0, 115200);
printf("SDK version:%s\n", sdk_system_get_sdk_version()); printf("SDK version:%s\n", sdk_system_get_sdk_version());
xTaskCreate(task1, (signed char *)"tsk1", 256, NULL, 2, NULL); xTaskCreate(task1, (signed char *)"tsk1", 256, NULL, 2, NULL);
} }

View file

@ -8,7 +8,7 @@
* This sample code is in the public domain., * This sample code is in the public domain.,
*/ */
#include "espressif/esp_common.h" #include "espressif/esp_common.h"
#include "espressif/sdk_private.h" #include "esp/uart.h"
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "mbedtls/md.h" #include "mbedtls/md.h"
@ -130,7 +130,7 @@ static void test_md5(void)
void user_init(void) void user_init(void)
{ {
sdk_uart_div_modify(0, UART_CLK_FREQ / 115200); uart_set_baud(0, 115200);
test_md5(); test_md5();