[GitHub] [mynewt-nimble] bvdberg commented on pull request #1494: mynewt: fix assert

2023-05-11 Thread via GitHub


bvdberg commented on PR #1494:
URL: https://github.com/apache/mynewt-nimble/pull/1494#issuecomment-1545132030

   changed so your suggestion


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [mynewt-core] andrzej-kaczmarek commented on a diff in pull request #2993: nrf53: Add APIs to change Low Frequency Clock source in the runtime

2023-05-11 Thread via GitHub


andrzej-kaczmarek commented on code in PR #2993:
URL: https://github.com/apache/mynewt-core/pull/2993#discussion_r1191739523


##
hw/mcu/nordic/nrf5340_net/src/nrf5340_net_clock.c:
##
@@ -75,3 +75,64 @@ nrf5340_net_clock_hfxo_release(void)
 
 return stopped;
 }
+
+/**
+ * Request low frequency clock source change.
+ *
+ * @return int 0: clock source was already as requested. 1: clock source
+ * changed.
+ */
+int
+nrf5340_net_set_lf_clock_source(uint32_t clksrc)
+{
+uint32_t regmsk;
+uint32_t regval;
+
+regmsk = CLOCK_LFCLKSTAT_STATE_Msk | CLOCK_LFCLKSTAT_SRC_Msk;
+regval = CLOCK_LFCLKSTAT_STATE_Running << CLOCK_LFCLKSTAT_STATE_Pos;
+
+regval |= clksrc << CLOCK_LFCLKSTAT_SRC_Pos;
+
+/* Check if this clock source isn't already running */
+if ((NRF_CLOCK_NS->LFCLKSTAT & regmsk) == regval) {
+return 0;
+}
+
+/*
+ * Request HFXO if LFSYNTH is going to be set as source. If LFSYNTH is 
going to be
+ * replaced with other source, release HFXO.
+ */
+if (clksrc == CLOCK_LFCLKSTAT_SRC_LFSYNT) {
+if ((NRF_CLOCK_NS->HFCLKSTAT & CLOCK_HFCLKSTAT_STATE_Msk) !=
+(CLOCK_HFCLKSTAT_STATE_Running << CLOCK_HFCLKSTAT_STATE_Pos)) {
+NRF_CLOCK_NS->EVENTS_HFCLKSTARTED = 0;
+nrf5340_net_clock_hfxo_request();
+while (1) {

Review Comment:
   ```
   while (!NRF_CLOCK_NS->EVENTS_HFCLKSTARTED) {
   }
   ```



##
hw/mcu/nordic/nrf5340_net/src/nrf5340_net_clock.c:
##
@@ -75,3 +75,64 @@ nrf5340_net_clock_hfxo_release(void)
 
 return stopped;
 }
+
+/**
+ * Request low frequency clock source change.
+ *
+ * @return int 0: clock source was already as requested. 1: clock source
+ * changed.
+ */
+int
+nrf5340_net_set_lf_clock_source(uint32_t clksrc)
+{
+uint32_t regmsk;
+uint32_t regval;
+
+regmsk = CLOCK_LFCLKSTAT_STATE_Msk | CLOCK_LFCLKSTAT_SRC_Msk;
+regval = CLOCK_LFCLKSTAT_STATE_Running << CLOCK_LFCLKSTAT_STATE_Pos;
+
+regval |= clksrc << CLOCK_LFCLKSTAT_SRC_Pos;
+
+/* Check if this clock source isn't already running */
+if ((NRF_CLOCK_NS->LFCLKSTAT & regmsk) == regval) {
+return 0;
+}
+
+/*
+ * Request HFXO if LFSYNTH is going to be set as source. If LFSYNTH is 
going to be
+ * replaced with other source, release HFXO.
+ */
+if (clksrc == CLOCK_LFCLKSTAT_SRC_LFSYNT) {
+if ((NRF_CLOCK_NS->HFCLKSTAT & CLOCK_HFCLKSTAT_STATE_Msk) !=
+(CLOCK_HFCLKSTAT_STATE_Running << CLOCK_HFCLKSTAT_STATE_Pos)) {
+NRF_CLOCK_NS->EVENTS_HFCLKSTARTED = 0;
+nrf5340_net_clock_hfxo_request();
+while (1) {
+if ((NRF_CLOCK_NS->EVENTS_HFCLKSTARTED) != 0) {
+break;
+}
+}
+} else {
+nrf5340_net_clock_hfxo_request();
+}
+} else if ((NRF_CLOCK_NS->LFCLKSTAT & CLOCK_LFCLKSTAT_SRC_Msk) ==

Review Comment:
   `LFCLKSRC` can be used instead of masking



##
hw/mcu/nordic/nrf5340_net/src/nrf5340_net_clock.c:
##
@@ -75,3 +75,64 @@ nrf5340_net_clock_hfxo_release(void)
 
 return stopped;
 }
+
+/**
+ * Request low frequency clock source change.
+ *
+ * @return int 0: clock source was already as requested. 1: clock source
+ * changed.
+ */
+int
+nrf5340_net_set_lf_clock_source(uint32_t clksrc)
+{
+uint32_t regmsk;
+uint32_t regval;
+
+regmsk = CLOCK_LFCLKSTAT_STATE_Msk | CLOCK_LFCLKSTAT_SRC_Msk;
+regval = CLOCK_LFCLKSTAT_STATE_Running << CLOCK_LFCLKSTAT_STATE_Pos;
+
+regval |= clksrc << CLOCK_LFCLKSTAT_SRC_Pos;
+
+/* Check if this clock source isn't already running */
+if ((NRF_CLOCK_NS->LFCLKSTAT & regmsk) == regval) {
+return 0;
+}
+
+/*
+ * Request HFXO if LFSYNTH is going to be set as source. If LFSYNTH is 
going to be
+ * replaced with other source, release HFXO.
+ */
+if (clksrc == CLOCK_LFCLKSTAT_SRC_LFSYNT) {
+if ((NRF_CLOCK_NS->HFCLKSTAT & CLOCK_HFCLKSTAT_STATE_Msk) !=
+(CLOCK_HFCLKSTAT_STATE_Running << CLOCK_HFCLKSTAT_STATE_Pos)) {
+NRF_CLOCK_NS->EVENTS_HFCLKSTARTED = 0;
+nrf5340_net_clock_hfxo_request();
+while (1) {
+if ((NRF_CLOCK_NS->EVENTS_HFCLKSTARTED) != 0) {
+break;
+}
+}
+} else {
+nrf5340_net_clock_hfxo_request();
+}
+} else if ((NRF_CLOCK_NS->LFCLKSTAT & CLOCK_LFCLKSTAT_SRC_Msk) ==
+   CLOCK_LFCLKSTAT_SRC_LFSYNT) {
+nrf5340_net_clock_hfxo_release();
+}
+
+NRF_CLOCK_NS->TASKS_LFCLKSTOP = 1;
+NRF_CLOCK_NS->EVENTS_LFCLKSTARTED = 0;
+NRF_CLOCK_NS->LFCLKSRC = clksrc;
+NRF_CLOCK_NS->TASKS_LFCLKSTART = 1;

Review Comment:
   lfclk source can be changes without restarting lfclk:
   `The LFCLK source can be configured at any time (for instance, when the 
LFCLK has already been started). The content of the 

[GitHub] [mynewt-nimble] sjanc commented on pull request #1494: mynewt: fix assert

2023-05-11 Thread via GitHub


sjanc commented on PR #1494:
URL: https://github.com/apache/mynewt-nimble/pull/1494#issuecomment-1544094586

   yes, it does work so no need for #ifdef


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [mynewt-core] m-gorecki opened a new pull request, #2993: nrf53: Add APIs to change Low Frequency Clock source in the runtime

2023-05-11 Thread via GitHub


m-gorecki opened a new pull request, #2993:
URL: https://github.com/apache/mynewt-core/pull/2993

   This adds the same API for appcore and netcore.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [mynewt-nimble] bvdberg commented on pull request #1494: mynewt: fix assert

2023-05-11 Thread via GitHub


bvdberg commented on PR #1494:
URL: https://github.com/apache/mynewt-nimble/pull/1494#issuecomment-1544033158

   does that also work on MyNewt?
   so 
   BLE_LL_ASSERT(!ble_npl_event_is_queued(>sync_ev_end));
   or put in #else of #if MYNEWT
   ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [mynewt-nimble] bvdberg commented on pull request #1494: mynewt: fix assert

2023-05-11 Thread via GitHub


bvdberg commented on PR #1494:
URL: https://github.com/apache/mynewt-nimble/pull/1494#issuecomment-1543650184

   renamed commit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[mynewt-artifact] branch master updated: Integration with Github Actions

2023-05-11 Thread janc
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 8000a5a  Integration with Github Actions
8000a5a is described below

commit 8000a5a18b4584b6e49e1ae5b54ead499b278ea2
Author: Szymon Janc 
AuthorDate: Mon May 8 11:18:59 2023 +0200

Integration with Github Actions

ASF moved away from Travis to Github Actions.
---
 .travis.yml => .github/workflows/build.yml | 33 +++---
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/.travis.yml b/.github/workflows/build.yml
similarity index 65%
rename from .travis.yml
rename to .github/workflows/build.yml
index 77e2d73..2882b38 100644
--- a/.travis.yml
+++ b/.github/workflows/build.yml
@@ -1,3 +1,4 @@
+#
 # 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
@@ -14,18 +15,26 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+#
 
-language: go
-
-go:
-  - "1.x"
-
-env:
-  - GO111MODULE=on
+name: Build and test
 
-before_script:
-  - printenv
-  - go version
+on: [push, pull_request]
 
-script:
-  - go test -v ./...
+jobs:
+  test:
+strategy:
+  fail-fast: false
+  matrix:
+os: [ubuntu-latest]
+runs-on: ${{ matrix.os }}
+steps:
+  - uses: actions/checkout@v3
+  - uses: actions/setup-go@v3
+with:
+  go-version: 'stable'
+  - name: Run tests
+shell: bash
+run: |
+ go version
+ go test -v ./...



[GitHub] [mynewt-artifact] sjanc merged pull request #36: Integration with Github Actions

2023-05-11 Thread via GitHub


sjanc merged PR #36:
URL: https://github.com/apache/mynewt-artifact/pull/36


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org