Bug 16412 - pull-down on ALS pin is not disabled by als_init()
: pull-down on ALS pin is not disabled by als_init()
Status: RESOLVED FIXED
Product: SB Radio
Classification: Unclassified
Component: Power Management
: Include FW version in comment
: PC Windows Vista
: -- normal (vote)
: ---
Assigned To: Vahid Fereydouny
: factory_mp
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-28 15:32 UTC by Maurice Alou
Modified: 2010-11-09 13:44 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maurice Alou 2010-07-28 15:32:38 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
	}
}