Skip to content

Commit 1648b7d

Browse files
committed
Latest changes to V3 firmware
1 parent f9db764 commit 1648b7d

File tree

15 files changed

+153
-116
lines changed

15 files changed

+153
-116
lines changed

Firmware_V3/.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"files.associations": {
33
"*.tcc": "cpp",
4-
"functional": "cpp"
4+
"functional": "cpp",
5+
"typeinfo": "cpp"
56
}
67
}

Firmware_V3/include/globalvariables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ extern volatile bool longTouch;
8585
extern volatile bool serialMode;
8686
extern volatile byte loadTouch;
8787
extern volatile bool leptonBufferValid;
88-
extern volatile bool displayUpdated;
88+
extern volatile bool disableSPIIRQ;
8989

9090
#endif /* GLOBALVARIABLES_H */

Firmware_V3/include/loadmenu.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ bool convertPrompt();
2323
void convertVideo(char* dirname);
2424
void deleteImage(char* filename);
2525
void deleteVideo(char* dirname);
26-
void displayGUI(int imgCount, char* infoText);
27-
void displayVideoFrame(int i);
28-
uint16_t getVideoFrameNumber();
26+
void displayGUI(uint32_t imgCount, char* infoText);
27+
void displayVideoFrame(uint32_t imgCount);
28+
uint32_t getVideoFrameNumber();
2929
int loadMenu(char* title, int* array, int length);
30-
void openImage(char* filename, int imgCount);
31-
void playVideo(char* dirname, int imgCount);
30+
void openImage(char* filename, uint32_t imgCount);
31+
void playVideo(char* dirname, uint32_t imgCount);
3232

3333
#endif /* LOADMENU_H */

Firmware_V3/include/save.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818

1919
/*########################## PUBLIC PROCEDURES ################################*/
2020

21-
void createBMPFile(char* filename);
2221
void createSDName(char* filename, boolean folder = false);
23-
void frameFilename(char* filename, uint16_t count);
22+
void frameFilename(char* filename, uint32_t count);
2423
void imgSaveEnd();
2524
void imgSaveStart();
26-
void processVideoFrames(int framesCaptured, char* dirname);
25+
void processVideoFrames(uint32_t framesCaptured, char* dirname);
2726
void saveBuffer(char* filename);
28-
void saveRawData(bool isImage, char* name, uint16_t framesCaptured = 0);
27+
void saveRawData(bool isImage, char* name, uint32_t framesCaptured = 0);
2928
void saveVideoFrame(char* filename);
3029

3130
#endif /* SAVE_H */

Firmware_V3/include/videomenu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
/*########################## PUBLIC PROCEDURES ################################*/
2020

21-
void videoCaptureInterval(int16_t* remainingTime, int* framesCaptured);
22-
void videoCaptureNormal(int* framesCaptured);
21+
void videoCaptureInterval(int16_t* remainingTime, uint32_t* framesCaptured, uint16_t* folderFrames, char* buffer, char* dirName);
22+
void videoCaptureNormal(uint32_t* framesCaptured, uint16_t* folderFrames, char* buffer, char* dirName);
2323
void videoCapture();
2424
bool videoIntervalChooser();
2525
bool videoIntervalHandler(byte* pos);

Firmware_V3/lib/SdFat/src/SdFatConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ typedef uint8_t SdCsPin_t;
202202
* Set USE_SD_CRC to 2 to used a larger table driven CRC-CCITT function. This
203203
* function is faster for AVR but may be slower for ARM and other processors.
204204
*/
205-
#define USE_SD_CRC 0
205+
#define USE_SD_CRC 1
206206
//------------------------------------------------------------------------------
207207
/** If the symbol USE_FCNTL_H is nonzero, open flags for access modes O_RDONLY,
208208
* O_WRONLY, O_RDWR and the open modifiers O_APPEND, O_CREAT, O_EXCL, O_SYNC
31.4 KB
Binary file not shown.

Firmware_V3/src/general/globalvariables.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/*############################# PUBLIC VARIABLES ##############################*/
2727

2828
//Current firmware version
29-
char versionString[] = "Firmware 3.02 from 21.06.2021";
29+
char versionString[] = "Firmware 3.02 from 05.07.2021";
3030
uint16_t fwVersion = 302;
3131

3232
//320x240 buffer
@@ -150,4 +150,4 @@ volatile byte loadTouch;
150150
//Current buffer valid
151151
volatile bool leptonBufferValid;
152152
//Display is currently updated, do not use SPI in IRQ
153-
volatile bool displayUpdated;
153+
volatile bool disableSPIIRQ;

Firmware_V3/src/gui/loadmenu.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/*######################## PUBLIC FUNCTION BODIES #############################*/
3232

3333
/* Display the GUI elements for the load menu */
34-
void displayGUI(int imgCount, char* infoText) {
34+
void displayGUI(uint32_t imgCount, char* infoText) {
3535
//Set text color
3636
changeTextColor();
3737
//set Background transparent
@@ -89,9 +89,9 @@ void deleteVideo(char* dirname) {
8989
sd.chdir(dirname);
9090

9191
//Delete all files
92-
uint16_t videoCounter = 0;
92+
uint32_t videoCounter = 0;
9393
bool exists;
94-
char filename[] = "00000.DAT";
94+
char filename[] = "000000.DAT";
9595

9696
//Go through the frames
9797
while (1) {
@@ -106,15 +106,15 @@ void deleteVideo(char* dirname) {
106106
else
107107
sd.remove(filename);
108108
//Remove Bitmap if there
109-
strcpy(&filename[5], ".BMP");
109+
strcpy(&filename[6], ".BMP");
110110
if (sd.exists(filename))
111111
sd.remove(filename);
112112
//Remove Jpeg if there
113-
strcpy(&filename[5], ".JPG");
113+
strcpy(&filename[6], ".JPG");
114114
if (sd.exists(filename))
115115
sd.remove(filename);
116116
//Reset ending
117-
strcpy(&filename[5], ".DAT");
117+
strcpy(&filename[6], ".DAT");
118118
//Raise counter
119119
videoCounter++;
120120
}
@@ -265,8 +265,8 @@ void convertVideo(char* dirname) {
265265
sd.chdir("/");
266266
sd.chdir(dirname);
267267

268-
uint16_t frames = getVideoFrameNumber();
269-
char filename[] = "00000.BMP";
268+
uint32_t frames = getVideoFrameNumber();
269+
char filename[] = "000000.BMP";
270270

271271
//Delete the ending for a video
272272
dirname[14] = '\0';
@@ -298,7 +298,7 @@ void convertVideo(char* dirname) {
298298
}
299299

300300
/* Loads an image from the SDCard and prints it on screen */
301-
void openImage(char* filename, int imgCount) {
301+
void openImage(char* filename, uint32_t imgCount) {
302302
//Show message on screen
303303
showFullMessage((char*) "Please wait, image is loading..");
304304

@@ -352,10 +352,10 @@ void openImage(char* filename, int imgCount) {
352352
}
353353

354354
/* Get the number of frames in the video */
355-
uint16_t getVideoFrameNumber() {
356-
uint16_t videoCounter = 0;
355+
uint32_t getVideoFrameNumber() {
356+
uint32_t videoCounter = 0;
357357
bool exists;
358-
char filename[] = "00000.DAT";
358+
char filename[] = "000000.DAT";
359359

360360
//Look how many frames we have
361361
while (true) {
@@ -375,12 +375,12 @@ uint16_t getVideoFrameNumber() {
375375
}
376376

377377
/* Display the selected video frame */
378-
void displayVideoFrame(int i)
378+
void displayVideoFrame(uint32_t imgCount)
379379
{
380-
char filename[] = "00000.DAT";
380+
char filename[] = "000000.DAT";
381381

382382
//Get the frame name
383-
frameFilename(filename, i);
383+
frameFilename(filename, imgCount);
384384

385385
//Load Raw data
386386
loadRawData(filename);
@@ -390,24 +390,24 @@ void displayVideoFrame(int i)
390390
}
391391

392392
/* Play a video from the internal storage */
393-
void playVideo(char* dirname, int imgCount) {
393+
void playVideo(char* dirname, uint32_t imgCount) {
394394
char buffer[14];
395395
//Save the current frame number
396-
int frameNumber = 0;
396+
uint32_t frameNumber = 0;
397397

398398
//Switch to video folder
399399
sd.chdir("/");
400400
sd.chdir(dirname);
401401

402402
//Get the total number of frames in the dir
403-
uint16_t numberOfFrames = getVideoFrameNumber();
403+
uint32_t numberOfFrames = getVideoFrameNumber();
404404

405405
//Jump here when pausing a video
406406
showFrame:
407407
//Display frame
408408
displayVideoFrame(frameNumber);
409409
//Create string
410-
sprintf(buffer, "%5d / %-5d", frameNumber + 1, numberOfFrames);
410+
sprintf(buffer, "%6lu / %-6lu", frameNumber + 1, numberOfFrames);
411411
//Display GUI
412412
displayGUI(imgCount, buffer);
413413
//Display play message
@@ -464,7 +464,7 @@ void playVideo(char* dirname, int imgCount) {
464464
//Display frame
465465
displayVideoFrame(frameNumber);
466466
//Create string
467-
sprintf(buffer, "%5d / %-5d", frameNumber + 1, numberOfFrames);
467+
sprintf(buffer, "%6lu / %-6lu", frameNumber + 1, numberOfFrames);
468468
//Display GUI
469469
displayGUI(imgCount, buffer);
470470
}

Firmware_V3/src/gui/mainmenu.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,9 @@ void mainMenuHandler(byte *pos)
14281428
//Main loop
14291429
while (true)
14301430
{
1431+
//Enter mass storage on USB connect
1432+
checkMassStorage();
1433+
14311434
//Check for screen sleep
14321435
if (screenOffCheck())
14331436
drawMainMenu(*pos);

0 commit comments

Comments
 (0)