unsigned int Complete(void) { unsigned int result = AdcCountsToVoltage(AdcConversion<input, channel>::ReadADC()); LIGHT_SENSOR_SHUTDOWN(); Average.AddSample(result); return result; }
static void EnterShippingMode(void) { /* Turn off the watchdog timer */ WDTCTL = WDTPW + WDTHOLD; #ifdef DIGITAL ClearLcd(); #endif ConfigResetPin(RST_PIN_ENABLED); __delay_cycles(100000); __disable_interrupt(); __no_operation(); DisableRtosTick(); /* * the radio draws more current in reset than it does after * the patch is loaded */ DISABLE_DISPLAY_POWER(); DISABLE_LCD_ENABLE(); BATTERY_CHARGE_DISABLE(); LIGHT_SENSOR_SHUTDOWN(); BATTERY_SENSE_DISABLE(); HARDWARE_CFG_SENSE_DISABLE(); APPLE_POWER_DISABLE(); ACCELEROMETER_INT_DISABLE(); DISABLE_BUTTONS(); #ifdef DIGITAL /* SHIPPING */ ENABLE_SHIPPING_WAKEUP(); #endif SELECT_ACLK(SELA__REFOCLK); SELECT_FLLREF(SELREF__REFOCLK); UCSCTL8 &= ~SMCLKREQEN; UCSCTL6 |= SMCLKOFF; /* disable aclk */ P11SEL &= ~BIT0; XT1_Stop(); /* turn off the regulator */ PMMCTL0_H = PMMPW_H; PMMCTL0_L = PMMREGOFF; __low_power_mode_4(); __no_operation(); __no_operation(); /* should not get here without a power event */ SoftwareReset(); }
static void EnterShippingMode(void) { /* Turn off the watchdog timer */ WDTCTL = WDTPW | WDTHOLD; EnableRstPin(); __delay_cycles(100000); __disable_interrupt(); __no_operation(); /* * the radio draws more current in reset than it does after * the patch is loaded */ DISABLE_DISPLAY_POWER(); DISABLE_LCD_ENABLE(); BATTERY_CHARGE_DISABLE(); LIGHT_SENSOR_SHUTDOWN(); BATTERY_SENSE_DISABLE(); HARDWARE_CFG_SENSE_DISABLE(); APPLE_POWER_DISABLE(); ACCELEROMETER_INT_DISABLE(); DISABLE_BUTTONS(); SELECT_ACLK(SELA__REFOCLK); SELECT_FLLREF(SELREF__REFOCLK); UCSCTL8 &= ~SMCLKREQEN; UCSCTL6 |= SMCLKOFF; /* disable aclk */ P11SEL &= ~BIT0; XT1_Stop(); /* turn off the regulator */ unsigned char temp = PMMCTL0_L; PMMCTL0_H = PMMPW_H; PMMCTL0_L = PMMREGOFF | temp; LPM4; __no_operation(); __no_operation(); /* should not get here without a power event */ SoftwareReset(); }