Function should support ignoring spaces and underscores within the string, which are used as delimeters.
You may wish to factor out the hex parsing logic to one or more other functions, to separate it from the comma-searching nature of the TCMD_extract_ functions.
Requires a unit test.
Examples
Invalid: 0x0000 -> do not allow "0x" prefix
Valid: 0123FF -> simple example case, goes into length-3 byte array {0x01, 0x23, 0xFF} (which is the same as {1, 35, 255})
Valid: 01 -> {0x01}
Valid: 01_02_03 -> {1, 2, 3} (underscore can be a delimeter between bytes)
Invalid: 010_203 -> underscore/space cannot be a delimeter in the middle of bytes (must be between even-numbered hex chars)
TCMDEXEC_flash_write_hex
function, which currently throws an annoying build warningFunction should support ignoring spaces and underscores within the string, which are used as delimeters.
You may wish to factor out the hex parsing logic to one or more other functions, to separate it from the comma-searching nature of the
TCMD_extract_
functions.Requires a unit test.
Examples
0x0000
-> do not allow "0x" prefix0123FF
-> simple example case, goes into length-3 byte array{0x01, 0x23, 0xFF}
(which is the same as{1, 35, 255}
)01
->{0x01}
01_02_03
->{1, 2, 3}
(underscore can be a delimeter between bytes)010_203
-> underscore/space cannot be a delimeter in the middle of bytes (must be between even-numbered hex chars)1
,12345
-> must be an even length01_02_3
-> must be an even length