   			break;
 
 		case EDIT_ALARM_MODE:
-			if (alarmOn)
-			{
-				alarmOn = 0;
+			if (isRtcAlarmOn())
+			{
+				disableRtcAlarm();
 				for (int i = 0; i < N; i++)
 					display.disableDecimalPoint(i);
 			} else 
 			{
-				alarmOn = 1;
+				enableRtcAlarm();
 				for (int i = 0; i < N; i++)
 					display.enableDecimalPoint(i);
 			}

#include <Wire.h>
#include <OneWire.h>
#include <TimerOne.h>
#include <DallasTemperature.h>
#include <OneButton.h>
#include <Time.h>
#include <MCP79412RTC.h>
#include <avr/pgmspace.h>

#include "SevenSegController.h"
#include "pitches.h"

// ---------------------- //
//  display control pins

byte fsmState       = 0;
byte activeDigit    = 0;
byte digitValues[N] = {0,0,0,0};
int  tempInCelsius  = 0;
unsigned long updateInterval    = 100;
unsigned long lastTempRead      = 0;
