Fix serial port switching, archive firmware.elf

This commit is contained in:
Filip Ayazi 2023-03-01 04:52:06 +00:00
parent ffb0b04c03
commit 54c34683c0
3 changed files with 12 additions and 9 deletions

View file

@ -17,10 +17,11 @@ before_script:
build: build:
stage: build stage: build
script: script:
- "pio run -e nano -e leonardo -e pico -e bluepill -e esp32" - "pio run -e nano -e leonardo -e pico -e bluepill -e esp32"
- mkdir -p builds - mkdir -p builds
- cp .pio/build/pico/firmware.uf2 builds/ - cp .pio/build/pico/firmware.uf2 builds/
- cp .pio/build/pico/firmware.elf builds/
artifacts: artifacts:
paths: paths:
- builds/* - builds/*

View file

@ -186,13 +186,14 @@ void setup()
comPort = (HardwareSerial*) &PRIMARY_SERIAL_PORT; comPort = (HardwareSerial*) &PRIMARY_SERIAL_PORT;
PRIMARY_SERIAL_PORT.begin(115200); PRIMARY_SERIAL_PORT.begin(115200);
while (!PRIMARY_SERIAL_PORT) #ifdef SECONDARY_SERIAL_PORT
delay(1); SECONDARY_SERIAL_PORT.begin(115200);
#if defined(SECONDARY_SERIAL_PORT) //wait for either port to be ready
SECONDARY_SERIAL_PORT.begin(115200); while (!PRIMARY_SERIAL_PORT && !SECONDARY_SERIAL_PORT)
while (!SECONDARY_SERIAL_PORT) #else
delay(1); while (!PRIMARY_SERIAL_PORT)
#endif #endif
delay(1);
register_module(core_commands, NULL); register_module(core_commands, NULL);

View file

@ -9,7 +9,7 @@ void test_single_argument_parsing(void)
String all_args = F("3123.123asdf"); String all_args = F("3123.123asdf");
char * args[1]; char * args[1];
uint8_t ret = 0; uint8_t ret = 0;
ret = parse_arguments(args, all_args, 1); ret = parse_arguments(args, all_args, 1);
TEST_ASSERT_EQUAL_STRING(expected_single, args[0]); TEST_ASSERT_EQUAL_STRING(expected_single, args[0]);
TEST_ASSERT_EQUAL(1, ret); TEST_ASSERT_EQUAL(1, ret);
@ -70,7 +70,8 @@ void test_multiple_argument_parsing(void)
void setup() { void setup() {
comPort->begin(115200); //TODO: support serial selection in tests
Serial.begin(115200);
// NOTE!!! Wait for >2 secs // NOTE!!! Wait for >2 secs
// if board doesn't support software reset via comPort->DTR/RTS // if board doesn't support software reset via comPort->DTR/RTS
delay(2000); delay(2000);