Do not send if USB is not active

Removed_REF_marker
erikkaashoek 5 years ago
parent 87318d9c1d
commit 3a671a71f2

@ -895,21 +895,27 @@ VNA_SHELL_FUNCTION(cmd_capture)
void send_region(const char *t, int x, int y, int w, int h) void send_region(const char *t, int x, int y, int w, int h)
{ {
shell_printf(t); if (SDU1.config->usbp->state == USB_ACTIVE) {
struct { shell_printf(t);
char new_str[2]; struct {
uint16_t x; char new_str[2];
uint16_t y; uint16_t x;
uint16_t w; uint16_t y;
uint16_t h; uint16_t w;
} region={"\r\n", x,y,w,h}; uint16_t h;
streamWrite(shell_stream, (void*)&region, sizeof(region)); } region={"\r\n", x,y,w,h};
streamWrite(shell_stream, (void*)&region, sizeof(region));
}
else
auto_capture = false;
} }
void send_buffer(uint8_t * buf, int s) void send_buffer(uint8_t * buf, int s)
{ {
streamWrite(shell_stream, (void*) buf, s); if (SDU1.config->usbp->state == USB_ACTIVE) {
streamWrite(shell_stream, (void*)"ch> \r\n", 6); streamWrite(shell_stream, (void*) buf, s);
streamWrite(shell_stream, (void*)"ch> \r\n", 6);
}
} }
#if 0 #if 0

Loading…
Cancel
Save

Powered by TurnKey Linux.