Permalink
Browse files

Added fixes for Cutdown at X time and Bitmask Uplink

  • Loading branch information...
Zuph committed Mar 21, 2011
1 parent 3b79874 commit 1e65c2bd54b05d1b472e3b182525e3dc3235109c
Showing with 14 additions and 48 deletions.
  1. +3 −3 WSB Flight Computer.depend
  2. +3 −42 main.c
  3. +3 −0 parsing/gps.c
  4. +5 −3 queue.c
@@ -649,7 +649,7 @@
"../dataStructures.h"
"openlog.h"
-1300128097 source:/home/bradluyster/Dev/git/LVL1-Transatlantic-Balloon/Software/fcpu/WSB Flight Computer/main.c
+1300652007 source:/home/bradluyster/Dev/git/LVL1-Transatlantic-Balloon/Software/fcpu/WSB Flight Computer/main.c
<stdio.h>
<stdint.h>
<avr/io.h>
@@ -690,15 +690,15 @@
1298253528 /home/bradluyster/Dev/git/LVL1-Transatlantic-Balloon/Software/fcpu/WSB Flight Computer/eepromVars.h
<avr/eeprom.h>
-1298507494 source:/home/bradluyster/Dev/git/LVL1-Transatlantic-Balloon/Software/fcpu/WSB Flight Computer/parsing/gps.c
+1300655668 source:/home/bradluyster/Dev/git/LVL1-Transatlantic-Balloon/Software/fcpu/WSB Flight Computer/parsing/gps.c
<stdio.h>
<stdint.h>
<string.h>
<avr/pgmspace.h>
<avr/wdt.h>
"gps.h"
-1292126383 source:/home/bradluyster/Dev/git/LVL1-Transatlantic-Balloon/Software/fcpu/WSB Flight Computer/queue.c
+1300655711 source:/home/bradluyster/Dev/git/LVL1-Transatlantic-Balloon/Software/fcpu/WSB Flight Computer/queue.c
<stdio.h>
<stdint.h>
<string.h>
View
45 main.c
@@ -242,52 +242,13 @@ int main (void)
}
- lprintf("SSAlive\n");
-
- //lprintf("psamp\n");
- //Test Routine for data Storage and Retreival
- /*char sample1[SAMPLESTRINGSIZEINCHARS]= "0,583,0,72,0,+18.24";
- char sample2[SAMPLESTRINGSIZEINCHARS]= "0,282,0,80,0,+18.90";
- char sample3[SAMPLESTRINGSIZEINCHARS]= "0,163,0,04,0,-24.20";
-
- putDataSample(sample1);
- eeprom_write_word(&EEbatchSampleEnd, eeprom_read_word(&EEbatchSampleEnd)+1);
-
- putDataSample(sample2);
- eeprom_write_word(&EEbatchSampleEnd, eeprom_read_word(&EEbatchSampleEnd)+1);
-
- putDataSample(sample3);
- eeprom_write_word(&EEbatchSampleEnd, eeprom_read_word(&EEbatchSampleEnd)+1);
-
- lprintf("SampleStart: %d\n", eeprom_read_word(&EEbatchSampleStart));
- lprintf("SampleEnd: %d\n", eeprom_read_word(&EEbatchSampleEnd));
-
-
- loadBatch();
- */
-
- /*while(1)
- {
- struct gpsData testStruct;
- getGPS(&testStruct);
- _delay_ms(500);
- lprintf("stat: %c sats: %d\n", testStruct.status, testStruct.numberOfSats);
- lprintf("lat: %f lon: %f\n", testStruct.latitude, testStruct.longitude);
- lprintf("now: %ld\n", now());
-
- }*/
+ lprintf("SSAlive\n");
if((mcusr_mirror & 0x08) == 0x08)
{
//lprintf("WDTReset\n");
}
-
-
- //lprintf("WDTCR: %x\n", WDTCSR);
-
- //REMOVE BEFORE FLIGHT:
- //eeprom_write_byte(&EEflightPhase, 16);
uint32_t rnow = now();
scheduleQueueAdd(&resetWatchdog, rnow);
@@ -430,7 +391,7 @@ void receiveCommandHandler(uint8_t receiveDataLength, uint8_t* recieveData)
//set Custom Bitmask Select
//if(receiveDataLength == 13)
{
- eeprom_write_block((uint16_t*)recieveData[1], &EEcurrentTelemetryBitmap, sizeof(uint32_t)*3);
+ eeprom_write_block((uint8_t*)recieveData[1], &EEcurrentTelemetryBitmap, sizeof(uint32_t)*3);
}
break;
case 0x0A:
@@ -491,7 +452,7 @@ void receiveCommandHandler(uint8_t receiveDataLength, uint8_t* recieveData)
{
//It Looks Like You're trying to Schedule a cutdown!
//uint32_t time = ((uint32_t)recieveData[0] << 24) + ((uint32_t)recieveData[1] << 16) + ((uint32_t)recieveData[2] << 8) + recieveData[3];
- uint32_t time = ((uint32_t)recieveData[0]<<16) + ((uint32_t)recieveData[1] << 8);
+ uint32_t time = (((uint32_t)recieveData[0]<<8) + ((uint32_t)recieveData[1]))*60;
scheduleQueueAdd(&timedCutdown, time);
}
break;
View
@@ -56,6 +56,7 @@ void getGPS(struct gpsData *outputData)
}
lineBuff[i] = '\0';
errorTracker++;
+ wdt_reset();
} while((strncmp("$GPRMC", lineBuff, 6) != 0) && errorTracker < 100);
// End GPRMC Acquisition Section
@@ -148,6 +149,7 @@ void getGPS(struct gpsData *outputData)
i++;
}
errorTracker++;
+ wdt_reset();
lineBuff[i] = '\0';
} while((strncmp("$GPGSA", lineBuff, 6) != 0) && errorTracker < 100);
// End GPGSA Acquisition Section
@@ -210,6 +212,7 @@ void getGPS(struct gpsData *outputData)
}
lineBuff[i] = '\0';
errorTracker++;
+ wdt_reset();
} while((strncmp("$GPGGA", lineBuff, 6) != 0) && errorTracker < 100);
// End GPGGA Acquisition Section
wdt_reset();
View
@@ -84,11 +84,13 @@ int8_t scheduleQueueAlterTime(scheduledFunction thisFunction, uint32_t newTime)
/*#ifdef FCPUDEBUG
lprintf_P(PSTR("Running some function\n"));
#endif*/
- scheduleQueueAdd(storageFunction, newTime);
- }
+ scheduleQueueAdd(storageFunction, newTime);
+ return 0;
} else {
- scheduleQueueAdd(storageFunction, scheduleTime);
+ scheduleQueueAdd(storageFunction, scheduleTime);
+
}
}
+ return 1;
}

0 comments on commit 1e65c2b

Please sign in to comment.