Skip to content

Commit b82d005

Browse files
committed
Updated 1.1
1 parent a332cc1 commit b82d005

File tree

7 files changed

+66
-55
lines changed

7 files changed

+66
-55
lines changed

Quest_CLI/Quest_CLI_V1.0.ino renamed to Quest_CLI/Quest_CLI_V1.1.ino

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@
4141
user_text buffer text size same now.. Need to clean up code for humans..
4242
20231120 CLI_V1.0 Required to make a complete program - this file, CLI_V1.0,Quest_CLI.h, Quest_Flight.h,Quest_flight.cpp
4343
cmd_takeSphot , cmd_takeSpiphoto, nophotophoto, nophoto30K --,clean up code for understanding.
44-
44+
20231207 CLI_V1.1 Required to make a complete program - this file, CLI_V1.1,Quest_CLI.h, Quest_Flight.h,Quest_flight.cpp
45+
Fixed Bug of crrupted file names when being uploaded to the McMek. added terminal countdown for the "T"
46+
command during startup. Only affected file is CLI.V1.1 all other files
47+
do not need to change...Flight or libraries...
4548
* *****************************************************************************
4649
*/
4750
//
48-
int Qversion = 20230715; //Program version
51+
char Qversion [] = "CLI_V1.1"; //Program version
4952
const char compile_date[] = __DATE__ " " __TIME__;
5053
const char source_file[] = __FILE__;
51-
54+
//
5255
//-----includes--------------------
5356
#include <Wire.h>
5457
#include <i2cdetect.h>
@@ -634,9 +637,9 @@ void setup() {
634637
//
635638
//
636639
Serial.println("\r\n\n----------------------------------------------------------");
637-
Serial.println("\nSystem Startup - S3_40 Testing Command line interface 20220710");
640+
Serial.println("\nSystem Startup - S3_40 Testing Command line interface CLI_V1.1");
638641
Serial.println("interface not complete, look for future cleaner updates, Thank you!");
639-
Serial.println("add to change this is your playground to learn the S3_40 system\n");
642+
Serial.println("add to change this is your flight playground to learn the S3_40 system\n");
640643
//
641644
//------------ set digital IO to output and high ------------
642645
pinMode(IO7, OUTPUT); //
@@ -709,31 +712,7 @@ void setup() {
709712
Serial.println("SD installed OK");
710713
initSD(); //set up SD files and system files for operation
711714
//
712-
/*
713-
//----------------------------------------------------------------------
714-
//-------- Check for Cumulitive Mission Time file if no exist Create it
715-
//
716-
File CumMisClk = SD.open("CumMisClk.txt"); //name of file
717-
if (CumMisClk){
718-
Serial.println("CumMisClk file exist");
719-
}
720-
else{
721-
Serial.println("Made CumMisClk file");
722-
FsDateTime::setCallback(dateTime); //set time and date for file
723-
File CumMisClk = SD.open("CumMisClk.txt", FILE_WRITE);
724-
str=String(1);
725-
Serial.println(str);
726-
str.toCharArray(text_buf,11);
727-
CumMisClk.print(text_buf);
728-
729-
}
730-
CumMisClk.close();
731-
//
732-
Serial.println("CumMisClk.tct written");
733-
*/
734715
//----------------------------------------------------------------------
735-
//
736-
//
737716
//----------- System test flages ---------------------------------------
738717
//
739718
testing = false; //reset active command line processing flag
@@ -755,13 +734,12 @@ void loop() {
755734
Serial.println();
756735
Serial.print("Free Memory = "); Serial.print(freeMemory(), HEX);
757736
Serial.print(" HEX or "); Serial.print(freeMemory()); Serial.println(" DEC");
758-
cmd_stackandheap();
759737
//
760-
761738
Serial.println("\r\n\nInput 'T' to enter test within 15 seconds");
762739
//
763740
uint32_t currentMillis = millis(); //this is time now
764-
741+
uint16_t countdown = 15; //tet countdown clock
742+
long unsigned int milliscountdown = millis(); //countdown counter for test
765743
//??????????????????????????????????????????????????????????????????????????????????????????????????????
766744
// test for Flying(); //Set Flying active and go to flight programming
767745
//??????????????????????????????????????????????????????????????????????????????????????????????????????
@@ -776,6 +754,11 @@ void loop() {
776754
SoftwareReset();
777755
}
778756
}
757+
if(millis() - milliscountdown > 1000){ //count every second in waiting for test
758+
milliscountdown = millis();
759+
countdown--; //decrease count for test
760+
Serial.print("Enter 'T' for test else enter flying Wait time = "); Serial.print(countdown); Serial.print(" version = ");Serial.println(Qversion);
761+
}
779762
}
780763
if (testing == true) {
781764
SoftwareReset();
@@ -2350,8 +2333,9 @@ void Hostinterupt() {
23502333
uint16_t retval; //meke return error test reg
23512334
retval = getFilefromQue(args[1]); //get the file name in args[1]
23522335
if (retval == 0) { //returned value ==0, got a regonized name
2353-
//Serial.print("got filename:"); //sayso
2354-
//Serial.println(args[1]); //print out the name
2336+
// Serial.print("got filename:"); //sayso
2337+
// Serial.println(args[1]); //print out the name
2338+
Chardelay(); //delay to let master to recover
23552339
} else {
23562340
Serial.println("err: got no filename"); //error does not know file
23572341
EIC->INTFLAG.reg = EIC_INTFLAG_EXTINT(0); //abort reset the IRQ Flag

Quest_CLI/Quest_Flight.ino

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
1-
/**
2-
*
3-
* 20231110 Version 1.0
4-
@file flying.ino
5-
@author howell ivy
6-
@brief Logic for experiment My-Cool-Experiment
7-
@version 1.0
8-
@date 2023-07-15
9-
10-
20231120 CLI_V1.0 Required to make a complete program - this file, CLI_V1.0,Quest_CLI.h, Quest_Flight.h,Quest_flight.cpp
11-
cmd_takeSphot , cmd_takeSpiphoto, nophotophoto, nophoto30K --,clean up code for understanding.
12-
1+
/*
2+
****************************************************************************************
3+
****************************************************************************************
4+
20231121
5+
Files Required to make a complete program -
6+
CLI_V1.0, Quest_CLI.h, Quest_Flight.h, Quest_flight.cpp
7+
Important Functions and their use:
8+
cmd_takeSphot
9+
This function will use the serial camera (the one with the cable) to take a photo (jpg)
10+
on the transfer of this photo to the Host controller it will create a text file (txt)
11+
with the same file name as the jpg file of the conditions of when the jpg was taken.
12+
NOTE: add2text can be used with this command
13+
cmd_takeSpiphoto
14+
This function is for the SPI camera (the one that plugges directly on the microlab board)
15+
it will take a jpg the same as the serial camera, also creating a txt file. Also NOTE: the
16+
add2text function can be used on the photo text file.
17+
nophotophoto
18+
if a camera is not being used, then this will simulate the camera photo operation. The text file
19+
is still created, so the add2text function can be used the get data downloaded in the text file
20+
nophoto30K
21+
this dois not use a camera, instead it uses the file space for the photo the containe ascii data
22+
using dataappend function defined below. The data will still have a jpg etension, but the file
23+
will contain ascii of the data put in buy the dataappend unction. Plus a text file is generated,
24+
and the add2text function will add more data.
25+
-----
26+
add2text(int value1,int value2,int value3)
27+
this function will take the three varables and place them at the end of the text file (the file is
28+
limited the 1024 charators), if you look at the function the text output can be formatted is almost
29+
any way. Look at it and change it to acccomadate your data...
30+
dataappend(int counts,int ampli,int SiPM,int Deadtime)
31+
this function will add ascii data to the 30K byte data buffer that was used a a jpg photo. look at
32+
the data formating and change it necessary for you project information. To view the data, you can
33+
use a hex/ascii file viewer or change the ext to a txt. then it should be viewable with a text exitor.
34+
.
35+
******************************************************************************************
36+
******************************************************************************************
1337
*/
1438

1539
#include "Quest_Flight.h"
@@ -48,8 +72,8 @@
4872
//
4973
//
5074
void Flying() {
51-
Serial.println("Here to Run flight program, not done yet 20230718");
52-
Serial.println(" 20231116 working on it");
75+
//
76+
Serial.println("\n\rRun flight program\n\r");
5377
//
5478
uint32_t TimeEvent1 = millis(); //set TimeEvent1 to effective 0
5579
uint32_t Sensor1Timer = millis(); //clear sensor1Timer to effective 0

libraries/Adafruit_BME680_Library/Adafruit_BME680.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <Adafruit_Sensor.h>
3333
#include <Wire.h>
3434

35-
#define BME68X_DEFAULT_ADDRESS (0x77) ///< The default I2C address
35+
#define BME68X_DEFAULT_ADDRESS (0x76) ///< The default I2C address
3636
#define BME68X_DEFAULT_SPIFREQ (1000000) ///< The default SPI Clock speed
3737

3838
#define BME680_OS_16X BME68X_OS_16X ///< Alias for BME680 existing examples

libraries/Quest_fram/Quest_fram.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int initfram(){
175175
Serial.println("\n\rFram Memory bad or not intalled\r\n Program will not function correctly\n\r");
176176
}
177177
Serial.println("Initing Fram Memory");
178-
writeIDfram('B'); //default ID = XY into Fram
178+
writeIDfram('I'); //default ID = XY into Fram
179179
//
180180
// uint16_t x = readIDfram();
181181
// if(x!=0x5859){
@@ -188,7 +188,8 @@ int initfram(){
188188
writeintfram( 0, Resetaddress);
189189
writeintfram( 0, PCSaddress);
190190
writeintfram( 0, PCPaddress);
191-
writeintfram( 0, PCDaddress);
191+
writeintfram( 0, PCDaddress);
192+
writeintfram( 0, W24HOURS);
192193
//
193194
// head of Que pointer
194195
// writelongfram(0x55555555, CumUnix); //total unix
@@ -202,6 +203,7 @@ int initfram(){
202203
Serial.print("PCSaddress = ");Serial.println(PCSaddress);
203204
Serial.print("PCPaddress = ");Serial.println(PCPaddress);
204205
Serial.print("PCDaddress = ");Serial.println(PCDaddress);
206+
Serial.print("W24HOURS = ");Serial.println(W24HOURS);
205207
//
206208
Serial.println("***** TEAM ID MUST NOW BE SET *****");
207209
return 0;

libraries/Quest_fram/Quest_fram.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const uint16_t PCPaddress = (PCSaddress + PCSsize); //PCDaddress number
4040
const uint16_t PCPsize = (2); //Size of PCDaddress
4141
const uint16_t PCDaddress = (PCPaddress + PCPsize); //PCMaddress number address Spi photos
4242
const uint16_t PCDsize = (2); //Size of PCMaddress
43+
const uint16_t W24HOURS = (PCDaddress+PCDsize); // Wait 24hour flag 0=not 24 hours yet
4344
//
4445
//
4546
//const statement[] = "this is an array in fram"

libraries/c329-SPI/QuestCameraC329SPI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ bool QuestCameraC329SPI::getPictureSPI(PictureType pictureType, void (*callback)
186186
{
187187
uint32_t pictureSize = 0;
188188

189-
resetSPI(RT_STATE); //hai
189+
// resetSPI(RT_STATE); //hai
190190

191191
// while (!waitForACK(SPIRESPONSE_DELAY, CMD_GETPICTURE) && ack_counter < 100) {
192192
// delay(10);

libraries/c329-SPI/QuestCameraC329SPI.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class QuestCameraC329SPI
7272
CT_RGB16 = 0x06,
7373
CT_RGB24 = 0x08,
7474
CT_YUV16 = 0x09,
75-
CT_JPEG = 0x07
75+
CT_JPEG = 0x87
7676
};
7777
enum PreviewResolution
7878
{
@@ -82,7 +82,7 @@ class QuestCameraC329SPI
8282
PR_176x144 = 0x04,
8383
PR_320x240 = 0x05,
8484
PR_352x288 = 0x06,
85-
PR_640x480 = 0x87,
85+
PR_640x480 = 0x07,
8686
PR_80x64 = 0x08,
8787
PR_128x96 = 0x09,
8888
PR_128x128 = 0x0A,
@@ -96,7 +96,7 @@ class QuestCameraC329SPI
9696
JR_176x144 = 0x04,
9797
JR_320x240 = 0x05,
9898
JR_352x288 = 0x06,
99-
JR_640x480 = 0x87,
99+
JR_640x480 = 0x07,
100100
JR_80x64 = 0x08,
101101
JR_128x96 = 0x09,
102102
JR_128x128 = 0x0A,

0 commit comments

Comments
 (0)