Skip to content

Commit

Permalink
added 0x00 byte to end of smard audio frame
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFastEnuf committed Aug 24, 2020
1 parent 7d472bb commit f7028aa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
66 changes: 33 additions & 33 deletions .settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -698,16 +698,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="Libraries/cbor/src">
Expand Down Expand Up @@ -747,16 +747,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main">
Expand Down Expand Up @@ -796,16 +796,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main/config">
Expand Down Expand Up @@ -845,16 +845,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/util">
Expand Down Expand Up @@ -894,16 +894,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main/usb">
Expand Down Expand Up @@ -943,16 +943,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/drivers">
Expand Down Expand Up @@ -992,16 +992,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/system/stm32f405">
Expand Down Expand Up @@ -1041,16 +1041,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main/rx">
Expand Down Expand Up @@ -1090,16 +1090,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/drivers/usb">
Expand Down Expand Up @@ -1139,16 +1139,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/system/stm32f411">
Expand Down Expand Up @@ -1305,16 +1305,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/quicksilver_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="84a042874c7aa03ab37c8bb5f1557f8bd6bb2ab2"/>
<entry kind="macro" name="GIT_VERSION" value="7d472bbe6997db7be8b2ce4fcb619f6ca57033b4"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="quicksilver_f4"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
</language>
Expand Down
9 changes: 4 additions & 5 deletions src/drivers/drv_serial_smart_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ smart_audio_update_result_t serial_smart_audio_update() {
}

void serial_smart_audio_send_payload(uint8_t cmd, const uint8_t *payload, const uint32_t size) {
frame_length = size + 1 + SA_HEADER_SIZE;
frame_length = size + 2 + SA_HEADER_SIZE;

frame[0] = 0x00;
frame[1] = 0xAA;
Expand All @@ -392,15 +392,14 @@ void serial_smart_audio_send_payload(uint8_t cmd, const uint8_t *payload, const
for (uint8_t i = 0; i < size; i++) {
frame[i + SA_HEADER_SIZE] = payload[i];
}
frame[size + SA_HEADER_SIZE] = crc8_data(frame + 1, frame_length - 2);

frame[size + SA_HEADER_SIZE] = crc8_data(frame + 1, frame_length - 3);
frame[size + 1 + SA_HEADER_SIZE] = 0x00;
circular_buffer_clear(&smart_audio_rx_buffer);
smart_audio_auto_baud();

quic_debugf("SMART_AUDIO: send cmd %d (%d)", cmd, size);
serial_smart_audio_send_data(frame, frame_length);

parser_state = PARSER_INIT;
last_valid_read = timer_millis();
}
#endif
#endif

0 comments on commit f7028aa

Please sign in to comment.