Skip to content

Commit

Permalink
Final check of ballast systems
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Jul 27, 2011
1 parent 6cd0d56 commit 9471c89
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions main.c
Expand Up @@ -107,6 +107,9 @@ void dumpTemps(void);
void debugBallast(void); void debugBallast(void);
void dumpGPS(void); void dumpGPS(void);


enum makerfaireMode { positive, negative };
makerfaireMode globalMode;

//DEFINE SCHEDULED THINGS //DEFINE SCHEDULED THINGS
void rapidHFXmit(uint32_t); void rapidHFXmit(uint32_t);
void timedCutdown(uint32_t); void timedCutdown(uint32_t);
Expand Down Expand Up @@ -277,7 +280,7 @@ int main (void)
scheduleQueueAdd(&transmitSamples, rnow); scheduleQueueAdd(&transmitSamples, rnow);
scheduleQueueAdd(&transmitShortReport, rnow+20); //Special case to give the comm controller a chance scheduleQueueAdd(&transmitShortReport, rnow+20); //Special case to give the comm controller a chance
#endif #endif
scheduleQueueAdd(&ballastStaticTickle, rnow); //scheduleQueueAdd(&ballastStaticTickle, rnow);
scheduleQueueAdd(&autoBallast, rnow); scheduleQueueAdd(&autoBallast, rnow);
scheduleQueueAdd(&flightPhaseLogic, rnow); scheduleQueueAdd(&flightPhaseLogic, rnow);


Expand Down Expand Up @@ -901,11 +904,17 @@ void processMonitor(uint32_t time)
//babysitting? //babysitting?
if(ballastBabySit) if(ballastBabySit)
{ {
lprintf_P(PSTR("BabySitting? Yes")); lprintf_P(PSTR("BabySitting? Yes,"));
} }
else else
{ {
lprintf_P(PSTR("BabySitting? No")); lprintf_P(PSTR("BabySitting? No,"));
}
if(globalMode == positive)
{
lprintf_P(PSTR(" Going Up!"));
} else {
lprintf_P(PSTR(" Going Down!"));
} }
lprintf_P(PSTR(" ***\n")); lprintf_P(PSTR(" ***\n"));


Expand Down Expand Up @@ -1056,12 +1065,14 @@ void autoBallast(uint32_t time)
#ifdef FCPUDEBUG #ifdef FCPUDEBUG
lprintf_P(PSTR("Ballast: TVSpeed+\n")); lprintf_P(PSTR("Ballast: TVSpeed+\n"));
#endif #endif
globalMode = positive;
currentTargetVspeed = eeprom_read_word(&EEballastTargetPositiveVSpeed); currentTargetVspeed = eeprom_read_word(&EEballastTargetPositiveVSpeed);
} else if(thisAltitude > targetAltitude) } else if(thisAltitude > targetAltitude)
{ {
#ifdef FCPUDEBUG #ifdef FCPUDEBUG
lprintf_P(PSTR("Ballast: TVSpeed-\n")); lprintf_P(PSTR("Ballast: TVSpeed-\n"));
#endif #endif
globalMode = negative;
currentTargetVspeed = eeprom_read_word(&EEballastTargetNegativeVSpeed); currentTargetVspeed = eeprom_read_word(&EEballastTargetNegativeVSpeed);
} /*else if(thisAltitude < targetAltitude && vSpeedAvg < currentTargetVspeed) } /*else if(thisAltitude < targetAltitude && vSpeedAvg < currentTargetVspeed)
{ {
Expand Down

0 comments on commit 9471c89

Please sign in to comment.