8000 made some minor changes · pycom/pycom-micropython-sigfox@9225fb3 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 9225fb3

Browse files
committed
made some minor changes
1 parent f7856c0 commit 9225fb3

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

esp32/pygate/hal/loragw_hal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
3737
#include "loragw_aux.h"
3838
#include "loragw_radio.h"
3939

40-
#include "py/mpprint.h"
41-
4240
/* -------------------------------------------------------------------------- */
4341
/* --- PRIVATE MACROS ------------------------------------------------------- */
4442
#define DEBUG_HAL 1
4543
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
4644
#if DEBUG_HAL == 1
47-
#define DEBUG_MSG(str) mp_printf(&mp_plat_print,stderr, str)
45+
#define DEBUG_MSG(str) fprintf(stderr, str)
4846
#define DEBUG_PRINTF(fmt, args...) fprintf(stderr,"%s:%d: "fmt, __FUNCTION__, __LINE__, args)
4947
#define DEBUG_ARRAY(a,b,c) for(a=0;a<b;++a) fprintf(stderr,"%x.",c[a]);fprintf(stderr,"end\n")
5048
#define CHECK_NULL(a) if(a==NULL){fprintf(stderr,"%s:%d: ERROR: NULL POINTER AS ARGUMENT\n", __FUNCTION__, __LINE__);return LGW_HAL_ERROR;}

esp32/pygate/lora_pkt_fwd/jitqueue.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ Maintainer: Michael Coracin
3434

3535
#include "loragw_hal.h"
3636

37-
#include "py/mpprint.h"
38-
3937
/* -------------------------------------------------------------------------- */
4038
/* --- PUBLIC CONSTANTS ----------------------------------------------------- */
4139

esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.c

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
6969
#include "lwip/apps/sntp.h"
7070
#include "utils/interrupt_char.h"
7171
#include "py/obj.h"
72+
#include "py/mpprint.h"
7273
#include "modmachine.h"
7374

7475
/* -------------------------------------------------------------------------- */
@@ -1236,7 +1237,7 @@ void TASK_lora_gw(void *pvParameters) {
12361237
}
12371238

12381239
machine_pygate_set_status(PYGATE_STARTED);
1239-
mp_printf(&mp_plat_print,"LoRa GW started\n");
1240+
mp_printf(&mp_plat_print, "LoRa GW started\n");
12401241

12411242
/* main loop task : statistics collection */
12421243
while (!exit_sig && !quit_sig) {
@@ -1325,32 +1326,32 @@ void TASK_lora_gw(void *pvParameters) {
13251326
#if DEBUG_LEVEL >= INFO_
13261327
if ( debug_level >= INFO_){
13271328
MSG_INFO("[main] report\n##### %s #####\n", stat_timestamp);
1328-
mp_printf(&mp_plat_print,"### [UPSTREAM] ###\n");
1329-
mp_printf(&mp_plat_print,"# RF packets received by concentrator: %u\n", cp_nb_rx_rcv);
1330-
mp_printf(&mp_plat_print,"# CRC_OK: %.2f%%, CRC_FAIL: %.2f%%, NO_CRC: %.2f%%\n", 100.0 * rx_ok_ratio, 100.0 * rx_bad_ratio, 100.0 * rx_nocrc_ratio);
1331-
mp_printf(&mp_plat_print,"# RF packets forwarded: %u (%u bytes)\n", cp_up_pkt_fwd, cp_up_payload_byte);
1332-
mp_printf(&mp_plat_print,"# PUSH_DATA datagrams sent: %u (%u bytes)\n", cp_up_dgram_sent, cp_up_network_byte);
1333-
mp_printf(&mp_plat_print,"# PUSH_DATA acknowledged: %.2f%%\n", 100.0 * up_ack_ratio);
1334-
mp_printf(&mp_plat_print,"### [DOWNSTREAM] ###\n");
1335-
mp_printf(&mp_plat_print,"# PULL_DATA sent: %u (%.2f%% acknowledged)\n", cp_dw_pull_sent, 100.0 * dw_ack_ratio);
1336-
mp_printf(&mp_plat_print,"# PULL_RESP(onse) datagrams received: %u (%u bytes)\n", cp_dw_dgram_rcv, cp_dw_network_byte);
1337-
mp_printf(&mp_plat_print,"# RF packets sent to concentrator: %u (%u bytes)\n", (cp_nb_tx_ok + cp_nb_tx_fail), cp_dw_payload_byte);
1338-
mp_printf(&mp_plat_print,"# TX errors: %u\n", cp_nb_tx_fail);
1329+
mp_printf(&mp_plat_print, "### [UPSTREAM] ###\n");
1330+
mp_printf(&mp_plat_print, "# RF packets received by concentrator: %u\n", cp_nb_rx_rcv);
1331+
mp_printf(&mp_plat_print, "# CRC_OK: %.2f%%, CRC_FAIL: %.2f%%, NO_CRC: %.2f%%\n", 100.0 * rx_ok_ratio, 100.0 * rx_bad_ratio, 100.0 * rx_nocrc_ratio);
1332+
mp_printf(&mp_plat_print, "# RF packets forwarded: %u (%u bytes)\n", cp_up_pkt_fwd, cp_up_payload_byte);
1333+
mp_printf(&mp_plat_print, "# PUSH_DATA datagrams sent: %u (%u bytes)\n", cp_up_dgram_sent, cp_up_network_byte);
1334+
mp_printf(&mp_plat_print, "# PUSH_DATA acknowledged: %.2f%%\n", 100.0 * up_ack_ratio);
1335+
mp_printf(&mp_plat_print, "### [DOWNSTREAM] ###\n");
1336+
mp_printf(&mp_plat_print, "# PULL_DATA sent: %u (%.2f%% acknowledged)\n", cp_dw_pull_sent, 100.0 * dw_ack_ratio);
1337+
mp_printf(&mp_plat_print, "# PULL_RESP(onse) datagrams received: %u (%u bytes)\n", cp_dw_dgram_rcv, cp_dw_network_byte);
1338+
mp_printf(&mp_plat_print, "# RF packets sent to concentrator: %u (%u bytes)\n", (cp_nb_tx_ok + cp_nb_tx_fail), cp_dw_payload_byte);
1339+
mp_printf(&mp_plat_print, "# TX errors: %u\n", cp_nb_tx_fail);
13391340
if (cp_nb_tx_requested != 0 ) {
1340-
mp_printf(&mp_plat_print,"# TX rejected (collision packet): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_collision_packet / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_collision_packet);
1341-
mp_printf(&mp_plat_print,"# TX rejected (collision beacon): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_collision_beacon / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_collision_beacon);
1342-
mp_printf(&mp_plat_print,"# TX rejected (too late): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_too_late / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_too_late);
1343-
mp_printf(&mp_plat_print,"# TX rejected (too early): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_too_early / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_too_early);
1341+
mp_printf(&mp_plat_print, "# TX rejected (collision packet): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_collision_packet / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_collision_packet);
1342+
mp_printf(&mp_plat_print, "# TX rejected (collision beacon): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_collision_beacon / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_collision_beacon);
1343+
mp_printf(&mp_plat_print, "# TX rejected (too late): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_too_late / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_too_late);
1344+
mp_printf(&mp_plat_print, "# TX rejected (too early): %.2f%% (req:%u, rej:%u)\n", 100.0 * cp_nb_tx_rejected_too_early / cp_nb_tx_requested, cp_nb_tx_requested, cp_nb_tx_rejected_too_early);
13441345
}
1345-
mp_printf(&mp_plat_print,"### [JIT] ###\n");
1346+
mp_printf(&mp_plat_print, "### [JIT] ###\n");
13461347
jit_print_queue (&jit_queue, false);
1347-
mp_printf(&mp_plat_print,"### [GPS] ###\n");
1348+
mp_printf(&mp_plat_print, "### [GPS] ###\n");
13481349
if (gps_fake_enable == true) {
1349< 67ED /code>-
mp_printf(&mp_plat_print,"# GPS *FAKE* coordinates: latitude %.5f, longitude %.5f, altitude %i m\n", cp_gps_coord.lat, cp_gps_coord.lon, cp_gps_coord.alt);
1350+
mp_printf(&mp_plat_print, "# GPS *FAKE* coordinates: latitude %.5f, longitude %.5f, altitude %i m\n", cp_gps_coord.lat, cp_gps_coord.lon, cp_gps_coord.alt);
13501351
} else {
1351-
mp_printf(&mp_plat_print,"# GPS sync is disabled\n");
1352+
mp_printf(&mp_plat_print, "# GPS sync is disabled\n");
13521353
}
1353-
mp_printf(&mp_plat_print,"##### END #####\n");
1354+
mp_printf(&mp_plat_print, "##### END #####\n");
13541355
}
13551356
#endif
13561357

esp32/pygate/lora_pkt_fwd/trace.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ extern int debug_level;
4545
#define MSG_DX(LEVEL, fmt, ...) \
4646
do { \
4747
if (debug_level >= LEVEL) \
48-
mp_printf(&mp_plat_print, "hello world"); \
4948
mp_printf(&mp_plat_print, "[%u] lorapf: " #LEVEL " " fmt, mp_hal_ticks_ms(), ##__VA_ARGS__); \
5049
} while (0)
5150

0 commit comments

Comments
 (0)
0