mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Merge pull request #579 from nuclearbananaslug/patch-1
mirror: parse the monitor port argument
This commit is contained in:
1 file changed
+6
-5
+6
-5
@@ -846,9 +846,14 @@ void parse_mirror(void)
|
|||||||
if (cmd_words_len < 2)
|
if (cmd_words_len < 2)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
// The first argument is the mirroring (monitor) port
|
||||||
|
uint8_t ret = cmd_parse_port(cmd_words_b[1]);
|
||||||
|
if (ret == 0)
|
||||||
|
goto err;
|
||||||
|
mirroring_port = atoi_results_u8;
|
||||||
|
|
||||||
uint8_t w = 2;
|
uint8_t w = 2;
|
||||||
uint8_t port;
|
uint8_t port;
|
||||||
uint8_t ret;
|
|
||||||
while (w < cmd_words_len) {
|
while (w < cmd_words_len) {
|
||||||
uint8_t idx = cmd_words_b[w++];
|
uint8_t idx = cmd_words_b[w++];
|
||||||
ret = cmd_parse_port(idx);
|
ret = cmd_parse_port(idx);
|
||||||
@@ -858,10 +863,6 @@ void parse_mirror(void)
|
|||||||
idx += ret;
|
idx += ret;
|
||||||
port = atoi_results_u8;
|
port = atoi_results_u8;
|
||||||
|
|
||||||
// Use the first port argument as mirroring_port
|
|
||||||
if (w == 2)
|
|
||||||
mirroring_port = port;
|
|
||||||
|
|
||||||
ret = cmd_buffer[idx];
|
ret = cmd_buffer[idx];
|
||||||
uint16_t pmask = ((uint16_t)1) << port;
|
uint16_t pmask = ((uint16_t)1) << port;
|
||||||
if (ret != 't')
|
if (ret != 't')
|
||||||
|
|||||||
Reference in new issue
Block a user