Created
March 17, 2014 09:22
-
-
Save zrzka/9596240 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remaining time for the next nutrition alarm */ | |
RVRemainingTime=RVUserInterval-Suunto.mod(SUUNTO_DURATION, RVUserInterval); | |
/* Should we beep? */ | |
if ( SUUNTO_DURATION > 0 && RVRemainingTime == RVUserInterval ) { | |
/* Decide what we should use */ | |
if ( Suunto.mod( RVAlarmsCounter, RVUserGelCount + RVUserFoodCount ) < RVUserGelCount ) { | |
/* Use gel */ | |
RVBeepCounter=RVUserGelBeepsCount; | |
RVGelPrefix=1; | |
RVFoodPrefix=0; | |
RVPrefixCounter=RVUserPrefixDisplayTime; | |
} else { | |
/* Eat something */ | |
RVGelPrefix=0; | |
RVFoodPrefix=1; | |
RVBeepCounter=RVUserFoodBeepsCount; | |
RVPrefixCounter=RVUserPrefixDisplayTime; | |
} | |
RVAlarmsCounter=RVAlarmsCounter+1; | |
} | |
/* Show prefix */ | |
if ( RVPrefixCounter > 0 ) { | |
RVPrefixCounter=RVPrefixCounter-1; | |
if ( RVGelPrefix == 1 ) { | |
prefix="Gel"; | |
} else if ( RVFoodPrefix == 1 ) { | |
prefix="Food"; | |
} | |
} else { | |
prefix=""; | |
} | |
/* Beep & light if necessary */ | |
if ( RVBeepCounter > 0 ) { | |
RVBeepCounter=RVBeepCounter-1; | |
Suunto.alarmBeep(); | |
if ( RVUserUseLightWhenBeeping > 0 ) { | |
Suunto.light(); | |
} | |
} | |
/* Show remaining time to the next nutrition alarm */ | |
RESULT=RVRemainingTime; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment