You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2020/10/14 14:19:51 UTC

[mynewt-core] branch master updated: apps: Fix cbmem sizes

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 868cea2  apps: Fix cbmem sizes
868cea2 is described below

commit 868cea2d8841cb94f78704b58bc4d2aea911efb3
Author: Casper Meijn <ca...@meijn.net>
AuthorDate: Tue Oct 13 21:17:35 2020 +0200

    apps: Fix cbmem sizes
    
    The size passed to cbmem_init is in bytes. Therefore the datatype of
    cbmem_buf needs to be one byte long.
---
 apps/sensors_test/src/main.c  | 1 -
 apps/slinky/src/main.c        | 2 +-
 apps/slinky_oic/src/main.c    | 2 +-
 apps/splitty/src/main.c       | 2 +-
 docs/os/modules/logs/logs.rst | 3 ++-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c
index 363a3fe..e2447ea 100644
--- a/apps/sensors_test/src/main.c
+++ b/apps/sensors_test/src/main.c
@@ -106,7 +106,6 @@ static int sensor_oic_gap_event(struct ble_gap_event *event, void *arg);
 /* Task 1 */
 #define TASK1_PRIO (8)
 #define TASK1_STACK_SIZE    OS_STACK_ALIGN(192)
-#define MAX_CBMEM_BUF 600
 static struct os_task task1;
 static volatile int g_task1_loops;
 
diff --git a/apps/slinky/src/main.c b/apps/slinky/src/main.c
index b1c8f3e..e352303 100644
--- a/apps/slinky/src/main.c
+++ b/apps/slinky/src/main.c
@@ -79,7 +79,7 @@ static struct conf_handler test_conf_handler = {
 static uint8_t test8;
 static uint8_t test8_shadow;
 static char test_str[32];
-static uint32_t cbmem_buf[MAX_CBMEM_BUF];
+static uint8_t cbmem_buf[MAX_CBMEM_BUF];
 static struct cbmem cbmem;
 
 static char *
diff --git a/apps/slinky_oic/src/main.c b/apps/slinky_oic/src/main.c
index 35d5e9b..5d38f6b 100644
--- a/apps/slinky_oic/src/main.c
+++ b/apps/slinky_oic/src/main.c
@@ -89,7 +89,7 @@ static struct conf_handler test_conf_handler = {
 static uint8_t test8;
 static uint8_t test8_shadow;
 static char test_str[32];
-static uint32_t cbmem_buf[MAX_CBMEM_BUF];
+static uint8_t cbmem_buf[MAX_CBMEM_BUF];
 static struct cbmem cbmem;
 
 static char *
diff --git a/apps/splitty/src/main.c b/apps/splitty/src/main.c
index e3800fd..8ef8820 100644
--- a/apps/splitty/src/main.c
+++ b/apps/splitty/src/main.c
@@ -73,7 +73,7 @@ STATS_NAME_START(gpio_stats)
 STATS_NAME(gpio_stats, toggles)
 STATS_NAME_END(gpio_stats)
 
-static uint32_t cbmem_buf[MAX_CBMEM_BUF];
+static uint8_t cbmem_buf[MAX_CBMEM_BUF];
 static struct cbmem cbmem;
 
 static void
diff --git a/docs/os/modules/logs/logs.rst b/docs/os/modules/logs/logs.rst
index 2be7c79..de28a7b 100644
--- a/docs/os/modules/logs/logs.rst
+++ b/docs/os/modules/logs/logs.rst
@@ -157,7 +157,8 @@ circular buffer.
 
     #include <log/log.h>
 
-    static uint32_t cbmem_buf[MAX_CBMEM_BUF];
+    #define MAX_CBMEM_BUF 300
+    static uint8_t cbmem_buf[MAX_CBMEM_BUF];
     static struct cbmem cbmem;