Bugzilla – Bug 16412
pull-down on ALS pin is not disabled by als_init()
Last modified: 2010-11-09 13:44:36 UTC
The pull-down in enabled by adc_close() to prevent the pin from floating in low power mode. When the msp430 resumes operation, the als_init() is called but the pull-down is still enabled. The function should be: (see // MA: disable pull-up/down) void als_init(void) { if (!als_state.callback_is_registered) { rtc_register_callback(als_rtc_callback); als_state.callback_is_registered = 1; } if (!als_state.als_is_running) { als_state.als_is_running = 1; BIC(P2IE, PIN_P2_ALS_ANALOG); // make sure this interrupt is off BIS(P2DIR, PIN_P2_ALS_ANALOG); // output BIC(P2OUT, PIN_P2_ALS_ANALOG); // low BIC(P2REN, PIN_P2_ALS_ANALOG); // MA: disable pull-up/down BIC(P2IES, PIN_P2_ALS_ANALOG); // set pin to interrupt on rising edge als_reset_time = ((u32)get_time() << 15) | get_ta1r(); BIC(P2DIR, PIN_P2_ALS_ANALOG); // set pin to input BIS(P2IE, PIN_P2_ALS_ANALOG); // enable interrupt } }