-
-
Notifications
You must be signed in to change notification settings - Fork 12
Power saving #5
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestfirmwareIssue in the firmwareIssue in the firmware
Description
The following lines should turn off a few unused AVR peripherals, helping us save some power. I don't know how effective the saving will be, but I think it's a good idea to try and minimize our current draw, as some PSX controllers might already be quite demanding:
ADCSRA &= ~(1 << ADEN); // Turn off ADC
ACSR |= (1 << ACD); // Turn off Analog Comparator
DIDR1 |= (1 << AIN1D) | (1 << AIN0D); // Turn off AIN digital input buffer
PRR |= (1 << PRTWI) | \ // Turn off TWI/I2C Interface
(1 << PRTIM2) | \ // Turn off Timer 2
(1 << PRTIM1) | \ // Turn off Timer 1
(1 << PRSPI) | \ // Turn off SPI Interface
#ifndef ENABLE_SERIAL_DEBUG
(1 << PRUSART0) | \ // Turn off Serial Port
#endif
(1 << PRADC); // Turn off ADC
The last command might make the others redundant. I guess we should take some measures.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfirmwareIssue in the firmwareIssue in the firmware