some small work..
This commit is contained in:
@@ -20,7 +20,7 @@ struct name_fd {
|
||||
|
||||
/** pre-assigned file descriptors for names */
|
||||
static const struct name_fd name_fd_map[NAME_FD_MAP_LEN] = {
|
||||
{FNAME_DLNK, FD_DLNK}
|
||||
// {FNAME_DLNK, FD_DLNK}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ int _write(int fd, const char *buf, int len)
|
||||
switch (fd) {
|
||||
case FD_STDOUT: return (int)com_tx_block(debug_iface, buf, (size_t)len);
|
||||
case FD_STDERR: return (int)com_tx_block(debug_iface, buf, (size_t)len);
|
||||
case FD_DLNK: return (int)com_tx_block(data_iface, buf, (size_t)len);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,4 @@ enum {
|
||||
FD_STDIN = 0,
|
||||
FD_STDOUT = 1,
|
||||
FD_STDERR = 2,
|
||||
FD_DLNK = 3,
|
||||
};
|
||||
|
||||
#define FNAME_DLNK "dlnk"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "com_fileio.h"
|
||||
#include "debug.h"
|
||||
#include "com_fileio.h"
|
||||
#include "dspin.h"
|
||||
|
||||
SBMP_Endpoint *dlnk_ep;
|
||||
|
||||
@@ -30,6 +31,9 @@ void dlnk_init(void)
|
||||
static void dlnk_rx_bridge(ComIface *iface)
|
||||
{
|
||||
uint8_t b;
|
||||
|
||||
STATUS_LED_Port->BSRR = STATUS_LED_Pin;
|
||||
|
||||
while (com_rx(iface, &b)) {
|
||||
SBMP_RxStatus st = sbmp_ep_receive(dlnk_ep, b);
|
||||
|
||||
@@ -39,6 +43,8 @@ static void dlnk_rx_bridge(ComIface *iface)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
STATUS_LED_Port->BRR = STATUS_LED_Pin;
|
||||
}
|
||||
|
||||
/** Datalink Tx func */
|
||||
|
||||
@@ -7,15 +7,14 @@
|
||||
#include "main.h"
|
||||
#include <sbmp.h>
|
||||
|
||||
#define DG_REQUEST_RAW 40 // request raw vector. Sample count [u16], Frequency [u32]
|
||||
#define DG_REQUEST_FFT 41 // request fft vector. Sample count [u16], Frequency [u32]. Result - count/2 bins. Count must be 2^n, 16..2048
|
||||
#define DG_REQUEST_STORE_REF 42 // calculate signal signature & store for comparing
|
||||
#define DG_REQUEST_COMPARE_REF 43
|
||||
#define DG_MOTOR_HOME 40
|
||||
#define DG_MOTOR_GOTO 41
|
||||
|
||||
// wifi status & control
|
||||
#define DG_SETMODE_AP 44 // request AP mode (AP button pressed)
|
||||
#define DG_WPS_START 45 // start WPS
|
||||
#define DG_WIFI_STATUS 46 // WiFi status report
|
||||
#define DG_REQUEST_STM_VERSION 47 // Get acquisition module firmware version
|
||||
#define DG_WIFI_STATUS 46 // WiFi status report (sent by the ESP every second)
|
||||
#define DG_REQUEST_STM_VERSION 47 // Get STM32 module firmware version
|
||||
|
||||
|
||||
extern SBMP_Endpoint *dlnk_ep;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#define ESCAPE_DEBUG_MESSAGES 1
|
||||
|
||||
#define VERBOSE_LOGGING 1
|
||||
|
||||
|
||||
// formatting symbols
|
||||
#define DEBUG_EOL "\r\n"
|
||||
|
||||
@@ -66,7 +66,7 @@ static void if_poll(ComIface *iface)
|
||||
(void)iface;
|
||||
}
|
||||
|
||||
ComIface *com_noop_init(void)
|
||||
ComIface *noop_iface_init(void)
|
||||
{
|
||||
ComIface *iface = malloc_s(sizeof(ComIface));
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
* @param iface : iface pointer. If NULL, it'll be allocated.
|
||||
* @return the iface pointer.
|
||||
*/
|
||||
ComIface *com_noop_init(void);
|
||||
ComIface *noop_iface_init(void);
|
||||
|
||||
Reference in New Issue
Block a user