Merge pull request #3383 from cesanta/zeph

Zephyr nits
This commit is contained in:
Sergio R. Caprile
2025-12-23 13:45:42 -03:00
committed by GitHub
5 changed files with 31 additions and 7 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
revno: ["--mr v3.7-branch", "--mr v4.2.0"] # LTS, latest stable
revno: ["--mr v3.7-branch", "--mr v4.2.0", "--mr v4.3.0"] # LTS, latest stable
name: Zephyr ${{ matrix.revno }}
steps:
- uses: actions/checkout@v4
+9
View File
@@ -21460,6 +21460,15 @@ bool mg_random(void *buf, size_t len) {
#elif MG_ARCH == MG_ARCH_PICOSDK
while (len--) *p++ = (unsigned char) (get_rand_32() & 255);
success = true;
#elif MG_ARCH == MG_ARCH_ZEPHYR
#if MG_TLS == MG_TLS_BUILTIN || \
(MG_TLS == MG_TLS_MBED && (!defined(MBEDTLS_VERSION_NUMBER) || \
MBEDTLS_VERSION_NUMBER < 0x04000000))
return (sys_csrand_get(buf, len) == 0); // do not fallback on reseed error
#else
sys_rand_get(buf, len);
success = true;
#endif
#elif MG_ARCH == MG_ARCH_WIN32
#if defined(_MSC_VER) && _MSC_VER < 1700
static bool initialised = false;
+6 -3
View File
@@ -723,12 +723,15 @@ typedef int socklen_t;
#include <zephyr/kernel.h>
#include <zephyr/version.h>
#include <zephyr/net/socket.h>
//#include <zephyr/posix/dirent.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/posix/sys/select.h>
#include <zephyr/random/random.h>
#include <ctype.h>
#include <errno.h>
#include <zephyr/net/socket.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/posix/sys/select.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
+6 -3
View File
@@ -4,12 +4,15 @@
#include <zephyr/kernel.h>
#include <zephyr/version.h>
#include <zephyr/net/socket.h>
//#include <zephyr/posix/dirent.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/posix/sys/select.h>
#include <zephyr/random/random.h>
#include <ctype.h>
#include <errno.h>
#include <zephyr/net/socket.h>
#include <zephyr/posix/fcntl.h>
#include <zephyr/posix/sys/select.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
+9
View File
@@ -27,6 +27,15 @@ bool mg_random(void *buf, size_t len) {
#elif MG_ARCH == MG_ARCH_PICOSDK
while (len--) *p++ = (unsigned char) (get_rand_32() & 255);
success = true;
#elif MG_ARCH == MG_ARCH_ZEPHYR
#if MG_TLS == MG_TLS_BUILTIN || \
(MG_TLS == MG_TLS_MBED && (!defined(MBEDTLS_VERSION_NUMBER) || \
MBEDTLS_VERSION_NUMBER < 0x04000000))
return (sys_csrand_get(buf, len) == 0); // do not fallback on reseed error
#else
sys_rand_get(buf, len);
success = true;
#endif
#elif MG_ARCH == MG_ARCH_WIN32
#if defined(_MSC_VER) && _MSC_VER < 1700
static bool initialised = false;