Skip to content

Instantly share code, notes, and snippets.

@zrzka
Created March 17, 2014 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zrzka/9596240 to your computer and use it in GitHub Desktop.
Save zrzka/9596240 to your computer and use it in GitHub Desktop.
/* 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