diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..14c1fc0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Server Build +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + env: + alpine_url: http://dl-cdn.alpinelinux.org/alpine/v3.20 + SKIP_MODLOOP: 1 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: setup packages + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake ninja-build libconfig++-dev \ + libfftw3-dev zlib1g-dev libfdk-aac-dev libgps-dev libunwind-dev \ + libsqlite3-dev libcurl4-openssl-dev libssl-dev libconfig++-dev minify + + - name: Build + run: | + mkdir -p build && cd build + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_HDFL=OFF .. + cmake --build . --config Release diff --git a/CMakeLists.txt b/CMakeLists.txt index e9819df..359ea68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ set(UPSTREAM_DIR ${CMAKE_SOURCE_DIR}) find_program(MINIFY_COMMAND NAMES minify) option(ZYNQ "Build for Zynq7000 serial based WebSDR" ON) -option(RPI "Build for RPI serial based WebSDR" OFF) option(ENABLE_HDFL "Enable HFDL" ON) if(NOT CMAKE_BUILD_TYPE) @@ -19,25 +18,35 @@ endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "-Wall -fsingle-precision-constant -pthread") +set(CMAKE_CXX_FLAGS "-Wall -fsingle-precision-constant -ffast-math -pthread") set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_RELEASE "-g -O3") -set(CMAKE_C_FLAGS "-Wall -fsingle-precision-constant") +set(CMAKE_C_FLAGS "-Wall -fsingle-precision-constant -ffast-math") set(CMAKE_C_FLAGS_DEBUG "-g -O0") set(CMAKE_C_FLAGS_RELEASE "-g -O3") +set(PLATFORM zynq) +set(PLATFORM_INC ${PLATFORM}) +FILE(GLOB PLATFORM_SRCS + "${PLATFORM}/*.cpp" +) + +# Detect if host system is ARM +if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(PLATFORM_FLAGS -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -mvectorize-with-neon-quad) + set(PLATFORM_DEFINES + # for CMSIS + ARM_MATH_NEON + ARM_MATH_LOOPUNROLL -if(ZYNQ) - set(PLATFORM zynq) - set(PLATFORM_INC ${PLATFORM}) - set(PLATFORM_FLAGS -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -ffast-math -fsingle-precision-constant -mvectorize-with-neon-quad) - FILE(GLOB PLATFORM_SRCS - "${PLATFORM}/*.cpp" + # for SIMD + __ARM_NEON ) else() - # Not supported - MESSAGE(FATAL "Not supported") + set(PLATFORM_FLAGS -ffast-math) + set(ENABLE_HFDL OFF) + SET(EMULATOR ON) endif() find_package(PkgConfig REQUIRED) @@ -52,7 +61,11 @@ pkg_check_modules(SQLite3 REQUIRED sqlite3) pkg_check_modules(CURL REQUIRED libcurl) pkg_check_modules(SSL REQUIRED openssl) -set(CONFIG_LIBRARIES "/usr/lib/libconfig++.a") +if (EMULATOR) + pkg_check_modules(CONFIG REQUIRED libconfig++) +else() + set(CONFIG_LIBRARIES "/usr/lib/libconfig++.a") +endif() find_program(CCACHE_FOUND ccache) @@ -259,12 +272,7 @@ target_compile_definitions(websdr.bin PUBLIC MONGOOSE_USE_EXTRA_HTTP_HEADERS="Access-Control-Allow-Origin: *" EDATA_EMBED - # for CMSIS - ARM_MATH_NEON - ARM_MATH_LOOPUNROLL - - # for SIMD - __ARM_NEON + ${PLATFORM_DEFINES} # Enable SSL USE_SSL diff --git a/config.h b/config.h index 738fbce..293ba3f 100644 --- a/config.h +++ b/config.h @@ -44,8 +44,6 @@ typedef enum { ESPEED_AUTO = 0, #define PROXY_SERVER_HOST "proxy.rx-888.com" #define PROXY_SERVER_PORT 8073 -extern int rx_chans, wf_chans, nrx_bufs, nrx_samps, snd_rate, rx_decim; - // INET6_ADDRSTRLEN (46) plus some extra in case ipv6 scope/zone is an issue // can't be in net.h due to #include recursion problems #define NET_ADDRSTRLEN 64 diff --git a/extensions/ant_switch/ant_switch.cpp b/extensions/ant_switch/ant_switch.cpp index 929da47..166019c 100644 --- a/extensions/ant_switch/ant_switch.cpp +++ b/extensions/ant_switch/ant_switch.cpp @@ -38,27 +38,13 @@ static void ant_switch_init(int rx_chan) ext_send_msg(rx_chan, ANT_SWITCH_DEBUG_MSG, "EXT channels=%d", n_ch); } -int ant_switch_queryantennas() -{ - if (antenna_current) - { - // find the first 1 - for(int i = 0; i < kiwi.ant_switch_nch; i++) - { - if (antenna_current & (1 << i)) - return i + 1; - } - } - - return 0; -} - void ant_switch_setantenna(int antenna) { if (antenna == 0) antenna_current = 0; else - antenna_current |= 1 << (antenna - 1); + antenna_current = 1 << (antenna - 1); + fpga_set_antenna(antenna_current); return; } @@ -189,20 +175,31 @@ bool ant_switch_msgs(char *msg, int rx_chan) if (strcmp(msg, "GET Antenna") == 0) { - int selected_antennas = ant_switch_queryantennas(); - ext_send_msg(rx_chan, ANT_SWITCH_DEBUG_MSG, "EXT Antenna=%d", selected_antennas); + char buf[32] = ""; + if (antenna_current == 0) + snprintf(buf, sizeof(buf), "0"); + else { + for(int i = 0; i < kiwi.ant_switch_nch; i++) + { + if (antenna_current & (1 << i)) + sprintf(buf + strlen(buf), "%d,", i + 1); + } + buf[strlen(buf) - 1] = '\0'; // remove trailing comma + } + + ext_send_msg(rx_chan, ANT_SWITCH_DEBUG_MSG, "EXT Antenna=%s", buf); static int last_selected_antennas; - if (selected_antennas != last_selected_antennas) + if (antenna_current != last_selected_antennas) { char *s; - if (selected_antennas == 0) + if (antenna_current == 0) s = (char *)"All antennas now grounded."; else - s = stprintf("Selected antennas are now: %d", selected_antennas); + s = stprintf("Selected antennas are now: %s", buf); static u4_t seq; ext_notify_connected(rx_chan, seq++, s); - last_selected_antennas = selected_antennas; + last_selected_antennas = antenna_current; } int deny_reason = 0; @@ -225,7 +222,7 @@ bool ant_switch_msgs(char *msg, int rx_chan) { ext_send_msg(rx_chan, ANT_SWITCH_DEBUG_MSG, "EXT Thunderstorm=1"); // also ground antenna if not grounded - if (selected_antennas == 0) + if (antenna_current == 0) { ant_switch_setantenna(0); ext_send_msg(rx_chan, ANT_SWITCH_DEBUG_MSG, "EXT Antenna=g"); diff --git a/extensions/wspr/wspr_main.cpp b/extensions/wspr/wspr_main.cpp index 3e364e4..cbb23b1 100644 --- a/extensions/wspr/wspr_main.cpp +++ b/extensions/wspr/wspr_main.cpp @@ -496,8 +496,8 @@ void WSPR_Deco(void *param) wspr_decode_t *dp = &w->deco[i]; if (strcmp(dp->call, "...") == 0) continue; - mqtt_publish("WSPR", "\"call\":\"%s\",\"grid\":\"%s\",\"snr\":%.1f,\"dt\":%.1f,\"drift\":%d,\"freq\":%.6f,\"pwr\":%d", - dp->call, dp->grid, dp->snr, dp->dt_print, (int) dp->drift1, dp->freq_print, (int) dp->pwr); + mqtt_publish("WSPR", "\"call\":\"%s\",\"grid\":\"%s\",\"snr\":%.1f,\"dt\":%.1f,\"drift\":%d,\"freq\":%.6f,\"pwr\":%s", + dp->call, dp->grid, dp->snr, dp->dt_print, (int) dp->drift1, dp->freq_print, dp->pwr); if (w->autorun) { asprintf(&cmd, WSPR_SPOT, wspr_c.rcall, wspr_c.rgrid, rqrg, year%100, month, day, diff --git a/gps/gps.cpp b/gps/gps.cpp index e04425b..d4881c6 100644 --- a/gps/gps.cpp +++ b/gps/gps.cpp @@ -26,21 +26,15 @@ static void gps_task(void* param); static void pps_task(void* param); static void gps_connect() { - struct fixsource_t source; - blocking_system("/etc/init.d/gpsd restart"); - gpsd_source_spec(NULL, &source); - - if (0 != gps_open(source.server, source.port, &gps_handle)) { + if (0 != gps_open("localhost", "2947", &gps_handle)) { printf("open gpsd failed\n"); return; } int flags = WATCH_ENABLE; - if (source.device != NULL) - flags |= WATCH_DEVICE; - (void)gps_stream(&gps_handle, flags, source.device); + (void)gps_stream(&gps_handle, flags, NULL); } void gps_main(int argc, char* argv[]) { diff --git a/init/cfg.cpp b/init/cfg.cpp index 92ead86..9d5d3ac 100644 --- a/init/cfg.cpp +++ b/init/cfg.cpp @@ -156,6 +156,27 @@ static void cfg_test() { int serial_number; +// Hardware configuration variables +int rx_chans, wf_chans, nrx_samps, snd_rate, rx_decim; +int rx_num, wf_num, monitors_max; + +// System configuration variables +int debian_maj, debian_min, bg; +bool need_hardware, create_eeprom; + +// System state variables +u4_t ov_mask; +int is_locked, drm_nreg_chans; +bool have_ant_switch_ext, disable_led_task, kiwi_reg_debug; + +// GPS configuration variables +int gps_chans = GPS_MAX_CHANS; + +void cfg_hw_init() { + // Hardware configuration variables are initialized when hardware is detected + // or set via configuration/command line arguments +} + // only called once from main() void cfg_reload() { cfg_init(); diff --git a/init/cfg.h b/init/cfg.h index 0ae5614..ab1b4fc 100644 --- a/init/cfg.h +++ b/init/cfg.h @@ -234,3 +234,22 @@ typedef enum { CFG_OPT_NONE, CFG_OPT_ID1, CFG_OPT_ID2, CFG_OPT_NO_DOT } cfg_lookup_e; + +// Hardware configuration variables +extern int rx_chans, wf_chans, nrx_samps, snd_rate, rx_decim; +extern int rx_num, wf_num, monitors_max; + +// System configuration variables +extern int debian_maj, debian_min, bg; +extern bool need_hardware, create_eeprom; + +// System state variables +extern u4_t ov_mask; +extern int is_locked, drm_nreg_chans; +extern bool have_ant_switch_ext, disable_led_task, kiwi_reg_debug; + +// GPS configuration variables +extern int gps_chans; + +// Initialize hardware configuration +void cfg_hw_init(); diff --git a/kiwi.h b/kiwi.h index 98531d2..acfdfec 100644 --- a/kiwi.h +++ b/kiwi.h @@ -77,22 +77,16 @@ extern kiwi_t kiwi; extern int version_maj, version_min; -extern bool background_mode, need_hardware, any_preempt_autorun, - DUC_enable_start, rev_enable_start, web_nocache, kiwi_reg_debug, cmd_debug, - have_ant_switch_ext, disable_led_task, debug_printfs, force_camp, +extern bool background_mode, any_preempt_autorun, + DUC_enable_start, rev_enable_start, web_nocache, force_camp, snr_local_time, log_local_ip, DRM_enable, have_snd_users, admin_keepalive; -extern int ev_dump, tone, down, navg, meas, monitors_max, - gps_chans, rx_num, wf_num, bg, dx_print, - port, print_stats, serial_number, ip_limit_mins, is_locked, test_flag, n_camp, +extern int port, serial_number, ip_limit_mins, test_flag, n_camp, inactivity_timeout_mins, S_meter_cal, waterfall_cal, current_nusers, debug_v, utc_offset, dst_offset, reg_kiwisdr_com_status, kiwi_reg_lo_kHz, kiwi_reg_hi_kHz, - debian_maj, debian_min, use_foptim, web_caching_debug, - drm_nreg_chans, snr_meas_interval_hrs, snr_all, snr_HF, ant_connected; + web_caching_debug, snr_meas_interval_hrs, snr_all, snr_HF, ant_connected; extern char** main_argv; - -extern u4_t ov_mask; extern float g_genfreq, g_genampl, g_mixfreq, max_thr; extern double ui_srate, ui_srate_kHz, freq_offset_kHz, freq_offmax_kHz; #define freq_offset freq_offset_kHz // ant switch ext compatibility diff --git a/options.h b/options.h index 916cade..948a8c1 100644 --- a/options.h +++ b/options.h @@ -24,3 +24,9 @@ Boston, MA 02110-1301, USA. #define OPTION_DENY_APP_FINGERPRINT_CONN #define OPTION_EXPERIMENT_CICF //#define OPTION_HONEY_POT + +// Command-line options and runtime settings +extern int tone, down, navg, meas, print_stats, use_foptim; + +// Initialize options +void options_init(); diff --git a/support/debug.cpp b/support/debug.cpp index d332530..cad1fb0 100644 --- a/support/debug.cpp +++ b/support/debug.cpp @@ -8,6 +8,15 @@ #include #include +// Debug variables +int ev_dump = 0, test_flag, dx_print; +bool debug_printfs, cmd_debug; + +void debug_init() { + // Debug variables are initialized to their default values above + // or set via command line arguments +} + #ifdef EV_MEAS typedef struct { diff --git a/support/debug.h b/support/debug.h index dd9aa6c..d27987c 100644 --- a/support/debug.h +++ b/support/debug.h @@ -170,4 +170,11 @@ void ev(int cmd, int event, int param, const char* s, const char* s2); char* evprintf(const char* fmt, ...); +// Debug variables +extern int ev_dump, test_flag, dx_print; +extern bool debug_printfs, cmd_debug; + +// Initialize debug variables +void debug_init(); + #endif diff --git a/support/options.cpp b/support/options.cpp new file mode 100644 index 0000000..1e5de12 --- /dev/null +++ b/support/options.cpp @@ -0,0 +1,28 @@ +/* +-------------------------------------------------------------------------------- +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the +Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +Boston, MA 02110-1301, USA. +-------------------------------------------------------------------------------- +*/ + +// Copyright (c) 2014-2022 John Seamons, ZL4VO/KF6VO + +#include "options.h" + +// Command-line options and runtime settings +int tone, down, navg = 1, meas, print_stats, use_foptim; + +void options_init() { + // Options are initialized to their default values above + // or set via command line arguments +} \ No newline at end of file diff --git a/support/timing.h b/support/timing.h index 8cf469f..ba9df3b 100644 --- a/support/timing.h +++ b/support/timing.h @@ -27,7 +27,7 @@ #define MINUTES_TO_SEC(min) ((min)*60) #define SEC_TO_MINUTES(sec) ((sec) / 60) #define SEC_TO_MSEC(sec) ((sec)*1000) -#define SEC_TO_USEC(sec) ((sec)*1000000) +#define SEC_TO_USEC(sec) ((sec)*1000000LL) #define MSEC_TO_USEC(msec) ((msec)*1000) #define TIME_DIFF_MS(now, start) ((float)((now) - (start)) / 1e3) diff --git a/web/extensions/DRM/DRM.js b/web/extensions/DRM/DRM.js index 7621492..9bb5a39 100644 --- a/web/extensions/DRM/DRM.js +++ b/web/extensions/DRM/DRM.js @@ -861,14 +861,13 @@ function drm_schedule_time_freq(sort_by_freq) } drm.stations_freq.sort(function(a,b) { - var a_cmp = sort_by_freq? a.f : a.b; - var b_cmp = sort_by_freq? b.f : b.b; - var a_India = a.s.startsWith('India,'); - var b_India = b.s.startsWith('India,'); - - // always put India MW at bottom of schedules - if ( a_India && !b_India) return 1; - if (!a_India && b_India) return -1; + var a_cmp = sort_by_freq? a.f : a.br; + var b_cmp = sort_by_freq? b.f : b.br; + if (!sort_by_freq && a_cmp == b_cmp) { a_cmp = a.h; b_cmp = b.h; } + + // always put MW at bottom of schedules + if ( a.mw && !b.mw) return 1; + if (!a.mw && b.mw) return -1; //if (sort_by_freq) return ((a_cmp < b_cmp)? -1 : ((a_cmp > b_cmp)? 1:0)); @@ -995,7 +994,8 @@ function drm_get_stations_done_cb(stations) try { drm.stations = []; var idx = 0; - var region, station, freq, begin, end, wrap, prefix, verified, url; + var region, station, freq, begin, end, wrap, prefix, verified, url, mw, br, hrs; + var is_India_MW = false; stations.forEach(function(obj, i) { // each object of outer array prefix = ''; @@ -1017,6 +1017,7 @@ function drm_get_stations_done_cb(stations) var ae = ar1[i1]; if (i1 == 0 && isString(ae)) { url = ae; continue; } freq = ae; + mw = (freq >= 530 && freq <= 1700); i1++; ae = ar1[i1]; @@ -1027,13 +1028,18 @@ function drm_get_stations_done_cb(stations) verified = (begin < 0 || end < 0); if (drm.database != 0) verified = !verified; begin = Math.abs(begin); end = Math.abs(end); + br = Math.round(begin); wrap = (end < begin); if (wrap) { - drm.stations.push( { t:drm.MULTI, f:freq, s:station, r:region, b:begin, e:24, v:verified, u:url, i:idx } ); + hrs = Math.round(24 - begin); + drm.stations.push( { t:drm.MULTI, f:freq, s:station, r:region, b:begin, e:24, br:br, h:hrs, v:verified, u:url, i:idx, mw:mw } ); idx++; - drm.stations.push( { t:drm.MULTI, f:freq, s:station, r:region, b:0, e:end, v:verified, u:url, i:idx } ); - } else - drm.stations.push( { t:drm.MULTI, f:freq, s:station, r:region, b:begin, e:end, v:verified, u:url, i:idx } ); + hrs = Math.round(end); + drm.stations.push( { t:drm.MULTI, f:freq, s:station, r:region, b:0, e:end, br:br, h:hrs, v:verified, u:url, i:idx, mw:mw } ); + } else { + hrs = Math.round(end - begin); + drm.stations.push( { t:drm.MULTI, f:freq, s:station, r:region, b:begin, e:end, br:br, h:hrs, v:verified, u:url, i:idx, mw:mw } ); + } idx++; } } else { @@ -1042,13 +1048,18 @@ function drm_get_stations_done_cb(stations) verified = (begin < 0 || end < 0); if (drm.database != 0) verified = !verified; begin = Math.abs(begin); end = Math.abs(end); + br = Math.round(begin); wrap = (end < begin); if (wrap) { - drm.stations.push( { t:drm.SINGLE, f:freq, s:station, r:region, b:begin, e:24, v:verified, u:url, i:idx } ); + hrs = Math.round(24 - begin); + drm.stations.push( { t:drm.SINGLE, f:freq, s:station, r:region, b:begin, e:24, br:br, h:hrs, v:verified, u:url, i:idx, mw:mw } ); idx++; - drm.stations.push( { t:drm.SINGLE, f:freq, s:station, r:region, b:0, e:end, v:verified, u:url, i:idx } ); - } else - drm.stations.push( { t:drm.SINGLE, f:freq, s:station, r:region, b:begin, e:end, v:verified, u:url, i:idx } ); + hrs = Math.round(end); + drm.stations.push( { t:drm.SINGLE, f:freq, s:station, r:region, b:0, e:end, br:br, h:hrs, v:verified, u:url, i:idx, mw:mw } ); + } else { + hrs = Math.round(end - begin); + drm.stations.push( { t:drm.SINGLE, f:freq, s:station, r:region, b:begin, e:end, br:br, h:hrs, v:verified, u:url, i:idx, mw:mw } ); + } idx++; } } diff --git a/web/extensions/ant_switch/ant_switch.js b/web/extensions/ant_switch/ant_switch.js index b631947..80c332e 100644 --- a/web/extensions/ant_switch/ant_switch.js +++ b/web/extensions/ant_switch/ant_switch.js @@ -211,13 +211,13 @@ var ant_sw = { 'ant_switch.denyswitching', deny_select, ant_sw.deny_s, 'ant_switchdeny_cb' ), - w3_div('w3-margin-T-16','If antenna mixing is denied then users can select only one antenna at time.'), - w3_div('w3-margin-T-8', 'Deny antenna mixing? ' + + w3_div('w3-margin-T-16','If Single antenna mode is selected then users can select only one antenna at time.'), + w3_div('w3-margin-T-8', 'Single Antenna Mode? ' + w3_switch('', 'No', 'Yes', 'ant_switch.denymixing', denymixing_no_yes, 'ant_switch_confdenymixing') ), - w3_div('w3-margin-T-16','If multiuser is denied then antenna switching is disabled when more than one user is online.'), - w3_div('w3-margin-T-8', 'Deny multiuser switching? ' + + w3_div('w3-margin-T-16','If Single user mode is selected then antenna switching is disabled when more than one user is online.'), + w3_div('w3-margin-T-8', 'Enable Only single-user switching? ' + w3_switch('', 'No', 'Yes', 'ant_switch.denymultiuser', denymultiuser_no_yes, 'ant_switch_confdenymultiuser') ), diff --git a/web/kiwi/admin.js b/web/kiwi/admin.js index 2f0610c..e17a506 100644 --- a/web/kiwi/admin.js +++ b/web/kiwi/admin.js @@ -1058,9 +1058,6 @@ function network_html() ); var s2 = - '
' + - w3_div('id-net-config w3-container') + - '
' + w3_half('w3-container', '', w3_div('', @@ -1080,10 +1077,26 @@ function network_html() w3_label('id-net-check-port-ip-q w3-show-inline-block w3-margin-LR-16 w3-text-teal') + w3_div('id-net-check-port-ip-s w3-show-inline-block w3-text-black w3-background-pale-aqua') ) - ) + ), w3_div('id-net-config w3-container') ); - var s3 = + var s3 = '
' + + w3_third('w3-container w3-text-teal', 'w3-container', + w3_div('', + w3_text('w3-bold w3-text-teal', 'MQTT Configurations'), + w3_text('w3-text-black w3-show-block', "Leave Server name blank to disable MQTT.
Have to restart server to take effect.") + ), + w3_div('w3-margin-B-8 w3-text-teal', + w3_input_get('', 'MQTT Server', 'adm.mqtt_server', 'w3_string_set_cfg_cb', '', 'server name'), + w3_input_get('', 'MQTT Port', 'adm.mqtt_port', 'w3_int_set_cfg_cb', '1899', ''), + ), + w3_div('w3-margin-B-8 w3-text-teal', + w3_input_get('', 'MQTT Username', 'adm.mqtt_user', 'w3_string_set_cfg_cb', '', 'mqtt user'), + w3_input_get('', 'MQTT Password', 'adm.mqtt_password', 'w3_string_set_cfg_cb', '', 'mqtt password') + ) + ); + + var s4 = '
' + w3_div('w3-container w3-text-teal', w3_inline('w3-valign w3-halign-space-between/', @@ -1146,7 +1159,7 @@ function network_html() ) + '
'; - return w3_div('id-network w3-hide', s1 + s2 + s3); + return w3_div('id-network w3-hide', s1 + s2 + s3 + s4); } function network_ssl_container_init() diff --git a/web/web.cpp b/web/web.cpp index 9e19f80..226590b 100644 --- a/web/web.cpp +++ b/web/web.cpp @@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA. #include "ext_int.h" #include "debug.h" #include "services.h" +#include "options.h" #include #include diff --git a/zynq/peri.cpp b/zynq/peri.cpp index 63d1f0c..583b8a5 100644 --- a/zynq/peri.cpp +++ b/zynq/peri.cpp @@ -218,7 +218,7 @@ void fpga_rxfreq(int rx_chan, uint64_t freq) { void fpga_read_rx(void* buf, uint32_t size) { int rc; - struct rx_read_op read_op = { (__u32)buf, size }; + struct rx_read_op read_op = { (__u32)(uintptr_t)buf, size }; while (true) { // printf("In: 0x%x %d\t", read_op.address, read_op.length); @@ -394,7 +394,7 @@ void fpga_free_wf(int wf_chan, int rx_chan) { void fpga_read_wf(int wf_chan, void* buf, uint32_t size) { int rc; - struct wf_read_op read_op = { (__u16)wf_chan, (__u32)buf, (__u32)size }; + struct wf_read_op read_op = { (__u16)wf_chan, (__u32)(uintptr_t)buf, (__u32)size }; while (true) { // printf("In: 0x%x %d\t", read_op.address, read_op.length); rc = ioctl(ad8370_fd, WF_READ, &read_op);