You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ha...@apache.org on 2022/06/02 08:10:31 UTC

[mynewt-nimble] branch master updated (56cb10f8 -> 719bd3c4)

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

hauke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


    from 56cb10f8 tools/hci_throughput: Added NRF53 targets, README fix
     new b752f1be transport/monitor: fix unused variable warnings
     new c8a5122e drivers/nrf52: fix rfclk functions for RIOT
     new 5177f6c6 transport: expose ble_transport_init() in header
     new 0806f838 npl/hal: import hal_system.h
     new 510dc550 porting: fix transport init in nimble_port.c
     new 49001982 porting/os_mbuf: silence Wcast-align warnings
     new 719bd3c4 drivers/nrf51: add missing include of os_cputime.h

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nimble/drivers/nrf51/src/ble_phy.c                 |   2 +
 nimble/drivers/nrf52/src/ble_phy.c                 |   4 +-
 nimble/transport/include/nimble/transport.h        |   3 +
 .../transport/include/nimble/transport/monitor.h   |   2 +
 porting/nimble/include/hal/hal_system.h            | 110 +++++++++++++++++++++
 porting/nimble/include/os/os_mbuf.h                |   7 +-
 porting/nimble/src/nimble_port.c                   |   3 +-
 7 files changed, 124 insertions(+), 7 deletions(-)
 create mode 100644 porting/nimble/include/hal/hal_system.h


[mynewt-nimble] 01/07: transport/monitor: fix unused variable warnings

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b752f1bedca422e1d55f102ea8e23a17eb25ec78
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Thu Apr 28 11:59:37 2022 +0200

    transport/monitor: fix unused variable warnings
---
 nimble/transport/include/nimble/transport/monitor.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nimble/transport/include/nimble/transport/monitor.h b/nimble/transport/include/nimble/transport/monitor.h
index 6b56f123..623dc54a 100644
--- a/nimble/transport/include/nimble/transport/monitor.h
+++ b/nimble/transport/include/nimble/transport/monitor.h
@@ -35,6 +35,8 @@ int ble_monitor_log(int level, const char *fmt, ...);
 static inline int
 ble_monitor_log(int level, const char *fmt, ...)
 {
+    (void)level;
+    (void)fmt;
     return 0;
 }
 


[mynewt-nimble] 05/07: porting: fix transport init in nimble_port.c

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 510dc550ed488c5f690c8375a2db559ca4dde4b1
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Thu Apr 28 12:03:52 2022 +0200

    porting: fix transport init in nimble_port.c
---
 porting/nimble/src/nimble_port.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/porting/nimble/src/nimble_port.c b/porting/nimble/src/nimble_port.c
index 2a81fd63..1bd57f2b 100644
--- a/porting/nimble/src/nimble_port.c
+++ b/porting/nimble/src/nimble_port.c
@@ -24,7 +24,7 @@
 #include "nimble/nimble_port.h"
 #if NIMBLE_CFG_CONTROLLER
 #include "controller/ble_ll.h"
-#include "transport/ram/ble_hci_ram.h"
+#include "nimble/transport.h"
 #endif
 
 static struct ble_npl_eventq g_eventq_dflt;
@@ -46,7 +46,6 @@ nimble_port_init(void)
     ble_transport_hs_init();
 
 #if NIMBLE_CFG_CONTROLLER
-    ble_hci_ram_init();
 #ifndef RIOT_VERSION
     hal_timer_init(5, NULL);
     os_cputime_init(32768);


[mynewt-nimble] 02/07: drivers/nrf52: fix rfclk functions for RIOT

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c8a5122ebaf5fd2d478607e7e6ea4c151dc6fa50
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Thu Apr 28 12:01:09 2022 +0200

    drivers/nrf52: fix rfclk functions for RIOT
---
 nimble/drivers/nrf52/src/ble_phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nimble/drivers/nrf52/src/ble_phy.c b/nimble/drivers/nrf52/src/ble_phy.c
index dc8ba4e7..9b441238 100644
--- a/nimble/drivers/nrf52/src/ble_phy.c
+++ b/nimble/drivers/nrf52/src/ble_phy.c
@@ -2239,7 +2239,7 @@ void ble_phy_disable_dtm(void)
 void
 ble_phy_rfclk_enable(void)
 {
-#if MYNEWT
+#if MYNEWT || defined(RIOT_VERSION)
     nrf52_clock_hfxo_request();
 #else
     nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_HFCLKSTART);
@@ -2249,7 +2249,7 @@ ble_phy_rfclk_enable(void)
 void
 ble_phy_rfclk_disable(void)
 {
-#if MYNEWT
+#if MYNEWT || defined(RIOT_VERSION)
     nrf52_clock_hfxo_release();
 #else
     nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_HFCLKSTOP);


[mynewt-nimble] 03/07: transport: expose ble_transport_init() in header

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5177f6c6655905615da3f9949313075dd28adc17
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Thu Apr 28 12:02:25 2022 +0200

    transport: expose ble_transport_init() in header
---
 nimble/transport/include/nimble/transport.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nimble/transport/include/nimble/transport.h b/nimble/transport/include/nimble/transport.h
index 9e0eb669..fc3d7375 100644
--- a/nimble/transport/include/nimble/transport.h
+++ b/nimble/transport/include/nimble/transport.h
@@ -29,6 +29,9 @@ extern "C" {
 
 struct os_mbuf;
 
+/* Initialization */
+void ble_transport_init(void);
+
 /* Allocators for supported data types */
 void *ble_transport_alloc_cmd(void);
 void *ble_transport_alloc_evt(int discardable);


[mynewt-nimble] 06/07: porting/os_mbuf: silence Wcast-align warnings

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 49001982f2509c04de2a02150ee011a2c0a8fdac
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Thu Apr 28 12:23:48 2022 +0200

    porting/os_mbuf: silence Wcast-align warnings
---
 porting/nimble/include/os/os_mbuf.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/porting/nimble/include/os/os_mbuf.h b/porting/nimble/include/os/os_mbuf.h
index bee47d0b..6c05b2a7 100644
--- a/porting/nimble/include/os/os_mbuf.h
+++ b/porting/nimble/include/os/os_mbuf.h
@@ -132,12 +132,13 @@ struct os_mqueue {
     ((__om)->om_pkthdr_len >= sizeof (struct os_mbuf_pkthdr))
 
 /** Get a packet header pointer given an mbuf pointer */
-#define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *)     \
-    (void *)((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
+#define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *)(uintptr_t)  \
+                              (void *)((uint8_t *)&(__om)->om_data  \
+                              + sizeof(struct os_mbuf)))
 
 /** Given a mbuf packet header pointer, return a pointer to the mbuf */
 #define OS_MBUF_PKTHDR_TO_MBUF(__hdr)   \
-     (struct os_mbuf *)(void *)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
+    (struct os_mbuf *)(uintptr_t)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
 
 /**
  * Gets the length of an entire mbuf chain.  The specified mbuf must have a


[mynewt-nimble] 04/07: npl/hal: import hal_system.h

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0806f838674ca65e7b8289cacd1166c9c8c23aee
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Thu Apr 28 12:03:04 2022 +0200

    npl/hal: import hal_system.h
---
 porting/nimble/include/hal/hal_system.h | 110 ++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/porting/nimble/include/hal/hal_system.h b/porting/nimble/include/hal/hal_system.h
new file mode 100644
index 00000000..fa0255a6
--- /dev/null
+++ b/porting/nimble/include/hal/hal_system.h
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+/**
+ * @addtogroup HAL
+ * @{
+ *   @defgroup HALSystem HAL System
+ *   @{
+ */
+
+#ifndef H_HAL_SYSTEM_
+#define H_HAL_SYSTEM_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * System reset.
+ */
+void hal_system_reset(void) __attribute((noreturn));
+
+/**
+ * Called by bootloader to start loaded program.
+ */
+void hal_system_start(void *img_start) __attribute((noreturn));
+
+/**
+ * Called by split app loader to start the app program.
+ */
+void hal_system_restart(void *img_start) __attribute((noreturn));
+
+/**
+ * Returns non-zero if there is a HW debugger attached.
+ */
+int hal_debugger_connected(void);
+
+/**
+ * Reboot reason
+ */
+enum hal_reset_reason {
+    /** Power on Reset */
+    HAL_RESET_POR = 1,
+    /** Caused by Reset Pin */
+    HAL_RESET_PIN = 2,
+    /** Caused by Watchdog */
+    HAL_RESET_WATCHDOG = 3,
+    /** Soft reset, either system reset or crash */
+    HAL_RESET_SOFT = 4,
+    /** Low supply voltage */
+    HAL_RESET_BROWNOUT = 5,
+    /** Restart due to user request */
+    HAL_RESET_REQUESTED = 6,
+    /** System Off, wakeup on external interrupt*/
+    HAL_RESET_SYS_OFF_INT = 7,
+    /** Restart due to DFU */
+    HAL_RESET_DFU = 8,
+};
+
+/**
+ * Return the reboot reason
+ *
+ * @return A reboot reason
+ */
+enum hal_reset_reason hal_reset_cause(void);
+
+/**
+ * Return the reboot reason as a string
+ *
+ * @return String describing previous reset reason
+ */
+const char *hal_reset_cause_str(void);
+
+/**
+ * Starts clocks needed by system
+ */
+void hal_system_clock_start(void);
+
+/**
+ * Reset callback to be called before an reset happens inside hal_system_reset()
+ */
+void hal_system_reset_cb(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* H_HAL_SYSTEM_ */
+
+/**
+ *   @} HALSystem
+ * @} HAL
+ */


[mynewt-nimble] 07/07: drivers/nrf51: add missing include of os_cputime.h

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 719bd3c435b728f07ce7aaffaf6cebbd9c659a46
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Tue May 10 08:22:22 2022 +0200

    drivers/nrf51: add missing include of os_cputime.h
---
 nimble/drivers/nrf51/src/ble_phy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nimble/drivers/nrf51/src/ble_phy.c b/nimble/drivers/nrf51/src/ble_phy.c
index d3bc3c2e..a74252b5 100644
--- a/nimble/drivers/nrf51/src/ble_phy.c
+++ b/nimble/drivers/nrf51/src/ble_phy.c
@@ -22,6 +22,8 @@
 #include <assert.h>
 #include "syscfg/syscfg.h"
 #include "os/os.h"
+/* Keep os_cputime explicitly to enable build on non-Mynewt platforms */
+#include "os/os_cputime.h"
 #include "ble/xcvr.h"
 #include "nimble/ble.h"
 #include "nimble/nimble_opt.h"