Skip to content

Commit 9cb2337

Browse files
committed
Cleanup for release
1 parent 2be16f8 commit 9cb2337

6 files changed

Lines changed: 11 additions & 24 deletions

File tree

Firmware/FFBoard/Inc/CommandHandler.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77

88
#ifndef COMMANDHANDLER_H_
99
#define COMMANDHANDLER_H_
10-
//#include <CmdParser.h>
10+
1111
#include "ChoosableClass.h"
1212
#include <set>
1313
#include "mutex.hpp"
1414
#include "ClassIDs.h"
1515
#include <vector>
16-
//#include "CommandInterface.h"
1716

1817

1918
#define CMDFLAG_GET 0x01
@@ -136,7 +135,7 @@ class CommandHandler {
136135
virtual std::string getHelpstring(); // Returns a help string if "help" command is sent
137136
virtual std::string getCommandsHelpstring(); // Returns a list of the commands helpstrings
138137
virtual std::string getCsvHelpstring(); // Returns a list of the commands helpstrings formatted for csv
139-
//static void sendSerial(std::string cls,std::string cmd,std::string string,uint8_t prefix = 0xFF); //!< Send a command reply formatted sequence
138+
140139
static void logSerial(std::string string); //!< Send a log formatted sequence
141140

142141
void broadcastCommandReply(CommandReply reply, uint32_t cmdId,CMDtype type);
@@ -223,11 +222,8 @@ class CommandHandler {
223222
}
224223
}
225224

226-
//uint16_t commandHandlerID = 1; // 0 reserved for system
227-
228-
229225
std::vector<CmdHandlerCommanddef> registeredCommands;
230-
//void registerCommand(std::string cmd,uint16_t cmdid, std::string help="");
226+
231227
// Helper to be used with class enums
232228
template<typename ID>
233229
void registerCommand(const char* cmd,const ID cmdid,const char* help=nullptr,uint32_t flags = 0){
@@ -247,10 +243,6 @@ class CommandHandler {
247243
}
248244

249245

250-
// std::string clsname;
251-
// uint16_t clsid;
252-
// uint8_t cmdHandlerInstance=0;
253-
254246
CmdHandlerInfo cmdHandlerInfo;
255247

256248
};

Firmware/FFBoard/Src/EffectsCalculator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define X_AXIS_ENABLE 1
1515
#define Y_AXIS_ENABLE 2
1616
#define Z_AXIS_ENABLE 4
17-
//#define DEG_TO_RAD ((float)((float)M_PI / 180.0))
1817
#define DIRECTION_ENABLE (1 << MAX_AXIS)
1918

2019
#define EFFECT_STATE_INACTIVE 0

Firmware/FFBoard/Src/global_callbacks.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,20 +237,14 @@ uint8_t const * tud_hid_descriptor_report_cb(uint8_t itf){
237237

238238
void tud_cdc_rx_cb(uint8_t itf){
239239
pulseSysLed();
240-
// uint8_t buf[64];
241240
if(mainclass!=nullptr){
242241
mainclass->cdcRcvReady(itf);
243242
}
244-
// uint32_t count = tud_cdc_n_read(itf,buf, std::min<uint32_t>(mainclass->cdcFree(),sizeof(buf)));
245-
// mainclass->cdcRcv((char*)buf,&count);
246-
// }
247243
}
248244

249245
void tud_cdc_tx_complete_cb(uint8_t itf){
250-
//if(mainclass!=nullptr)
251-
//mainclass->cdcFinished(itf);
252-
CDCcomm::cdcFinished(itf);
253246

247+
CDCcomm::cdcFinished(itf);
254248
}
255249

256250

Firmware/FFBoard/UserExtensions/Inc/FFBoardMain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FFBoardMain : public ChoosableClass, public CommandHandler{
4545
virtual void update();
4646
virtual void cdcRcv(char* Buf, uint32_t *Len);
4747
virtual void cdcRcvReady(uint8_t itf);
48-
//virtual void cdcFinished(uint8_t itf); // Cdc send transfer complete
48+
4949
virtual void usbSuspend(); // Called on usb disconnect and suspend
5050
virtual void usbResume(); // Called on usb resume
5151

@@ -64,7 +64,7 @@ class FFBoardMain : public ChoosableClass, public CommandHandler{
6464

6565
protected:
6666
std::unique_ptr<USBdevice> usbdev;
67-
char cdcbuf[64];
67+
static char cdcbuf[]; // cdc buffer
6868
};
6969

7070

Firmware/FFBoard/UserExtensions/Src/FFBoardMain.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
ClassIdentifier FFBoardMain::info ={.name = "Basic" ,.id=0};
1616

17+
char FFBoardMain::cdcbuf[64];
18+
1719

1820

1921
FFBoardMain::FFBoardMain() : CommandHandler(CMDCLSTR_MAIN,CMDCLSID_MAIN,0), commandThread(std::make_unique<FFBoardMainCommandThread>(this)){
@@ -25,15 +27,15 @@ const ClassIdentifier FFBoardMain::getInfo(){
2527
}
2628

2729
/**
28-
* Called by the CDC serial port when data is received
30+
* Called when data is received on the CDC port
2931
*/
3032
void FFBoardMain::cdcRcv(char* Buf, uint32_t *Len){
3133

3234
cdcCmdInterface->addBuf(Buf, Len);
3335
}
3436

3537
/**
36-
* Called by the CDC serial port when data is received
38+
* Called by the CDC serial port when data is ready
3739
*/
3840
void FFBoardMain::cdcRcvReady(uint8_t itf){
3941

0 commit comments

Comments
 (0)