Skip to content

Commit

Permalink
Enable NEO6M for Beken, BL602, W800 and ESP -work-in-progress-!
Browse files Browse the repository at this point in the history
changed BL602 uart driver:
	don't echo every char,
	changed buffer to 256
BL602 works, but for me it crashes after some minutes - don't know why
  • Loading branch information
MaxineMuster committed Jan 12, 2025
1 parent 36400a4 commit 2269638
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions platforms/ESP-IDF/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ set(PROJ_ALL_SRC
# ../../../src/driver/drv_ucs1912.c
../../../src/driver/drv_wemo.c
../../../src/driver/drv_ds1820_simple.c
../../../src/driver/drv_neo6m.c
../../../src/hal/espidf/hal_adc_espidf.c
../../../src/hal/espidf/hal_flashConfig_espidf.c
../../../src/hal/espidf/hal_flashVars_espidf.c
Expand Down
1 change: 1 addition & 0 deletions platforms/W800/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ CSRCS += $(_SHARED_APP)/i2c/drv_i2c_lcd_pcf8574t.c
CSRCS += $(_SHARED_APP)/i2c/drv_i2c_mcp23017.c
CSRCS += $(_SHARED_APP)/driver/drv_dht_internal.c
CSRCS += $(_SHARED_APP)/driver/drv_openWeatherMap.c
CSRCS += $(_SHARED_APP)/driver/drv_neo6m.c
CSRCS += $(_SHARED_APP)/user_main.c
CSRCS += main.c

Expand Down
8 changes: 8 additions & 0 deletions src/driver/drv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "drv_bl0937.h"
#include "drv_bl0942.h"
#include "drv_bl_shared.h"
#include "drv_neo6m.h"
#include "drv_cse7766.h"
#include "drv_ir.h"
#include "drv_local.h"
Expand Down Expand Up @@ -152,6 +153,13 @@ static driver_t g_drivers[] = {
//drvdetail:"requires":""}
{ "BL0942", BL0942_UART_Init, BL0942_UART_RunEverySecond, BL09XX_AppendInformationToHTTPIndexPage, NULL, NULL, NULL, false },
#endif
#if ENABLE_DRIVER_NEO6M
//drvdetail:{"name":"NEO6M",
//drvdetail:"title":"TODO",
//drvdetail:"descr":"NEO6M is a GPS chip which uses UART protocol for communication. By default, it uses 9600 baud, but you can also enable it with other baud rates by using 'startDriver NEO6M <rate>'.",
//drvdetail:"requires":""}
{ "NEO6M", NEO6M_UART_Init, NEO6M_UART_RunEverySecond, NEO6M_AppendInformationToHTTPIndexPage, NULL, NULL, NULL, false },
#endif
#if ENABLE_DRIVER_PWM_GROUP
//drvdetail:{"name":"PWMG",
//drvdetail:"title":"TODO",
Expand Down
6 changes: 3 additions & 3 deletions src/hal/bl602/hal_uart_bl602.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int fd_console = -1;

static void console_cb_read(int fd, void* param)
{
char buffer[64]; /* adapt to usb cdc since usb fifo is 64 bytes */
char buffer[256]; /* adapt to usb cdc since usb fifo is 64 bytes */
int ret;
int i;

Expand All @@ -108,7 +108,7 @@ static void console_cb_read(int fd, void* param)
{
fd_console = fd;
buffer[ret] = 0;
addLogAdv(LOG_INFO, LOG_FEATURE_ENERGYMETER, "BL602 received: %s\n", buffer);
addLogAdv(LOG_DEBUG, LOG_FEATURE_ENERGYMETER, "BL602 received: %s\n", buffer);
for(i = 0; i < ret; i++)
{
UART_AppendByteToReceiveRingBuffer(buffer[i]);
Expand Down Expand Up @@ -163,4 +163,4 @@ int HAL_UART_Init(int baud, int parity)
return 1;
}

#endif
#endif
4 changes: 4 additions & 0 deletions src/obk_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#define OBK_OTA_EXTENSION ".img"
#define ENABLE_I2C 1
#define ENABLE_OBK_SCRIPTING 1
#define ENABLE_DRIVER_NEO6M 1


#elif WINDOWS
Expand Down Expand Up @@ -144,6 +145,7 @@
#define ENABLE_OBK_SCRIPTING 1
#define OBK_OTA_EXTENSION ".bin.xz.ota"
//#define ENABLE_I2C 1
#define ENABLE_DRIVER_NEO6M 1


#elif PLATFORM_BEKEN
Expand Down Expand Up @@ -205,6 +207,7 @@
#define ENABLE_OBK_SCRIPTING 1
//#define ENABLE_DRIVER_OPENWEATHERMAP 1
#define OBK_OTA_EXTENSION ".rbl"
#define ENABLE_DRIVER_NEO6M 1

// ENABLE_I2C_ is a syntax for
// our I2C system defines for drv_i2c_main.c
Expand Down Expand Up @@ -265,6 +268,7 @@
#define ENABLE_DRIVER_CHT83XX 1
#define ENABLE_OBK_SCRIPTING 1
#define OBK_OTA_EXTENSION ".img"
#define ENABLE_DRIVER_NEO6M 1

#elif PLATFORM_TR6260

Expand Down

0 comments on commit 2269638

Please sign in to comment.