Does Custom mode even work for the DCPump class? It doesn't appear to be implemented. In fact, the SyncSpeed and AntiSyncSpeed variables are not initialized and there is no default case in the switch statement, so it seems the behavior is pretty undefined:
Code: Select all
#ifdef DCPUMPCONTROL
if (DCPump.UseMemory)
{
DCPump.Mode=InternalMemory.DCPumpMode_read();
DCPump.Speed=InternalMemory.DCPumpSpeed_read();
DCPump.Duration=InternalMemory.DCPumpDuration_read();
DCPump.Threshold=InternalMemory.DCPumpThreshold_read();
}
byte SyncSpeed;
byte AntiSyncSpeed;
switch (DCPump.Mode)
{
case Constant:
{
SyncSpeed=DCPump.Speed;
AntiSyncSpeed=DCPump.Speed;
break;
}
case Lagoon:
{
SyncSpeed=ReefCrestMode(DCPump.Speed,10,true);
AntiSyncSpeed=ReefCrestMode(DCPump.Speed,10,false);
break;
}
case ReefCrest:
{
SyncSpeed=ReefCrestMode(DCPump.Speed,20,true);
AntiSyncSpeed=ReefCrestMode(DCPump.Speed,20,false);
break;
}
case ShortPulse:
{
SyncSpeed=ShortPulseMode(0,DCPump.Speed,DCPump.Duration*10,true);
AntiSyncSpeed=ShortPulseMode(0,DCPump.Speed,DCPump.Duration*10,false);
break;
}
case LongPulse:
{
SyncSpeed=LongPulseMode(0,DCPump.Speed,DCPump.Duration,true);
AntiSyncSpeed=LongPulseMode(0,DCPump.Speed,DCPump.Duration,false);
break;
}
case Gyre:
{
SyncSpeed=GyreMode(DCPump.Threshold,DCPump.Speed,DCPump.Duration,true);
AntiSyncSpeed=GyreMode(DCPump.Threshold,DCPump.Speed,DCPump.Duration,false);
break;
}
case NutrientTransport:
{
SyncSpeed=NutrientTransportMode(0,DCPump.Speed,DCPump.Duration*10,true);
AntiSyncSpeed=NutrientTransportMode(0,DCPump.Speed,DCPump.Duration*10,false);
break;
}
case TidalSwell:
{
SyncSpeed=TidalSwellMode(DCPump.Speed,true);
AntiSyncSpeed=TidalSwellMode(DCPump.Speed,false);
break;
}
case Sine:
{
SyncSpeed=SineMode(DCPump.Threshold,DCPump.Speed,DCPump.Duration,true);
AntiSyncSpeed=SineMode(DCPump.Threshold,DCPump.Speed,DCPump.Duration,false);
break;
}
case Else:
{
SyncSpeed=ElseMode(DCPump.Speed,DCPump.Duration,true);
AntiSyncSpeed=ElseMode(DCPump.Speed,DCPump.Duration,false);
break;
}
case Storm:
{
SyncSpeed=StormMode(DCPump.Speed,DCPump.Duration,true);
AntiSyncSpeed=StormMode(DCPump.Speed,DCPump.Duration,false);
break;
}
}
if (DisplayedMenu==FEEDING_MODE)
{
if (DCPump.FeedingSpeed < 100)
{
SyncSpeed=DCPump.FeedingSpeed;
AntiSyncSpeed=DCPump.FeedingSpeed;
}
}
if (DisplayedMenu==WATERCHANGE_MODE)
{
if (DCPump.WaterChangeSpeed < 100)
{
SyncSpeed=DCPump.WaterChangeSpeed;
AntiSyncSpeed=DCPump.WaterChangeSpeed;
}
}
SetDCPumpChannels(SyncSpeed,AntiSyncSpeed);
#endif // DCPUMPCONTROL