Skip to content

Commit 385465e

Browse files
committed
update tinyusb
1 parent 64b1ab8 commit 385465e

File tree

115 files changed

+30121
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+30121
-87
lines changed

.github/workflows/build-firmware.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
branches:
77
- master
88
- development
9+
- feature/add_esp32s2
910
pull_request:
1011
branches:
1112
- master
@@ -30,6 +31,8 @@ jobs:
3031
steps:
3132
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3233
- uses: actions/checkout@v2
34+
with:
35+
submodules: 'recursive'
3336

3437
- run: mkdir -p /tmp/armtc # make temp directory
3538

@@ -54,6 +57,12 @@ jobs:
5457
make -C ./Firmware clean
5558
make -j16 -C ./Firmware MCU_TARGET=${{ matrix.target }} OUTPUT_DIR=Output
5659
60+
- name: Build ESP32S2
61+
uses: espressif/esp-idf-ci-action@release-v4.4
62+
with:
63+
target: esp32s2
64+
path: './Firmware/Targets/ESP32S2'
65+
5766
- uses: actions/upload-artifact@v2
5867
with:
5968
name: OpenFFBoard-Firmware-${{ matrix.target }}

Firmware/FFBoard/Inc/CommandInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#ifdef HW_ESP32S2
1818
#define COMMANDINTERFACE_THREAD_MEM 2048
19-
#define COMMANDINTERFACE_THREAD_PRIO 9
19+
#define COMMANDINTERFACE_THREAD_PRIO (36*25/56)
2020
#else
2121
#define COMMANDINTERFACE_THREAD_MEM 256
2222
#define COMMANDINTERFACE_THREAD_PRIO 36

Firmware/FFBoard/Inc/DebugLog.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
#ifndef DEBUGLOG_H_
3+
#define DEBUGLOG_H_
4+
5+
#include "target_constants.h"
6+
7+
#ifdef __cplusplus
8+
extern "C" {
9+
#endif
10+
11+
// LOG DEBUG
12+
#ifdef HW_ESP32S2
13+
#define FFB_LOGI(format, ...) do { \
14+
ESP_LOGI(__FILE__, "%s(%d): " format, __FUNCTION__, __LINE__ __VA_OPT__(,) __VA_ARGS__); \
15+
} while(0)
16+
#define FFB_LOGW(format, ...) do { \
17+
ESP_LOGW(__FILE__, "%s(%d): " format, __FUNCTION__, __LINE__ __VA_OPT__(,) __VA_ARGS__); \
18+
} while(0)
19+
#define FFB_LOGE(format, ...) do { \
20+
ESP_LOGE(__FILE__, "%s(%d): " format, __FUNCTION__, __LINE__ __VA_OPT__(,) __VA_ARGS__); \
21+
} while(0)
22+
#define FFB_LOGD(format, ...) do { \
23+
ESP_LOGD(__FILE__, "%s(%d): " format, __FUNCTION__, __LINE__ __VA_OPT__(,) __VA_ARGS__); \
24+
} while(0)
25+
26+
#else
27+
28+
#define FFB_LOGI(format, ...)
29+
#define FFB_LOGW(format, ...)
30+
#define FFB_LOGE(format, ...)
31+
#define FFB_LOGD(format, ...)
32+
33+
#endif
34+
35+
36+
#ifdef __cplusplus
37+
}
38+
#endif
39+
40+
#endif /* DEBUGLOG_H_ */

Firmware/FFBoard/Inc/ErrorHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#ifdef HW_ESP32S2
1717
#define ERROR_PRINTER_MEM 4096
18-
#define ERROR_PRINTER_PRIO 10
18+
#define ERROR_PRINTER_PRIO 19*25/56
1919
#else
2020
#define ERROR_PRINTER_MEM 512
2121
#define ERROR_PRINTER_PRIO 19

Firmware/FFBoard/Inc/FFBoardMainCommandThread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#ifdef HW_ESP32S2
2626
#define FFBOARDMAINCOMMANDTHREAD_MEM 4096
27-
#define FFBOARDMAINCOMMANDTHREAD_PRIO 6
27+
#define FFBOARDMAINCOMMANDTHREAD_PRIO 35*25/56
2828
#else
2929
#define FFBOARDMAINCOMMANDTHREAD_MEM 1024
3030
#define FFBOARDMAINCOMMANDTHREAD_PRIO 35

Firmware/FFBoard/Inc/HidCommandInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#ifdef HW_ESP32S2
1717
#define HID_COMMANDINTERFACE_MEM 2048
18-
#define HID_COMMANDINTERFACE_PRIO 10
18+
#define HID_COMMANDINTERFACE_PRIO 18*25/56
1919
#else
2020
#define HID_COMMANDINTERFACE_MEM 256
2121
#define HID_COMMANDINTERFACE_PRIO 18

Firmware/FFBoard/Inc/USBdevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#ifdef HW_ESP32S2
1919
#define USBDEVICE_MEM 4096
20-
#define USBDEVICE_PRIO 10
20+
#define USBDEVICE_PRIO 40*25/56
2121
#else
2222
#define USBDEVICE_MEM 256
2323
#define USBDEVICE_PRIO 40

Firmware/FFBoard/Inc/cppmain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern "C" {
2222

2323
#include "eeprom_addresses.h"
2424
#include "main.h"
25-
25+
#include "DebugLog.h"
2626

2727
void cppmain();
2828
#ifndef HW_ESP32S2

Firmware/FFBoard/Src/CommandInterface.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void StringCommandInterface::generateReplyFromCmd(std::string& replyPart,const P
223223
*/
224224

225225

226-
CDC_CommandInterface::CDC_CommandInterface() : StringCommandInterface(32), Thread("CDCCMD", 512, 37) {
226+
CDC_CommandInterface::CDC_CommandInterface() : StringCommandInterface(32), Thread("CDCCMD", COMMANDINTERFACE_THREAD_MEM, COMMANDINTERFACE_THREAD_PRIO) {
227227
parser.setClearBufferTimeout(parserTimeout);
228228
this->Start();
229229
}
@@ -252,11 +252,13 @@ void CDC_CommandInterface::Run(){
252252
void CDC_CommandInterface::sendReplies(const std::vector<CommandResult>& results,CommandInterface* originalInterface){
253253

254254
if(HAL_GetTick() - lastSendTime > parserTimeout){
255+
FFB_LOGE("parserTimeout");
255256
resultsBuffer.clear(); // Empty buffer because we were not able to reply in time to prevent the full buffer from blocking future commands
256257
//CDCcomm::clearRemainingBuffer(0);
257258
}
258259

259260
if( (!enableBroadcastFromOtherInterfaces && originalInterface != this) ){
261+
FFB_LOGW("not originalInterface");
260262
return;
261263
}
262264
lastSendTime = HAL_GetTick();

Firmware/FFBoard/Src/FFBoardMainCommandThread.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ void FFBoardMainCommandThread::executeCommands(std::vector<ParsedCommand> comman
126126
while(!itf->readyToSend() && --remainingTime){
127127
Delay(1);
128128
}
129-
if(remainingTime)
129+
if(remainingTime) {
130130
itf->sendReplies(results, commandInterface);
131+
} else {
132+
FFB_LOGE("sendReplies wait for ready timeout");
133+
}
131134
}
132135
}
133136
}

0 commit comments

Comments
 (0)