现在我设计的按键有8个,系统时钟为2.7V/12MHz,测量的电流为4mA,然后我设置64HZ的休眠后,为什么电流还是没怎么降下去啊?难道还要别的设置吗,请高人指点。 程序如下:
#include <m8c.h> // part specific constants and macros #include "PSoCAPI.h" // PSoC API definitions for all User Modules
#pragma interrupt_handler Sleep_Timer_ISR void Sleep_Timer_ISR(void);
struct Info { BYTE data0; BYTE data1; BYTE data2; BYTE data3; BYTE data4; BYTE key1; }myInfo;
void CSD_SCAN(void); void main() { int i,j; M8C_EnableGInt; CSD_Start(); CSD_SetDefaultFingerThresholds(); CSD_InitializeBaselines(); CSD_baBtnFThreshold[2] = 70; CSD_baBtnFThreshold[3] = 70; CSD_baBtnFThreshold[4] = 70; CSD_baBtnFThreshold[5] = 70; CSD_baBtnFThreshold[6] = 70; CSD_baBtnFThreshold[7] = 70; for (i=0; i< 25000; i++) j=1; //Delay long enough for title and version to be displayed for (i=0; i< 25000; i++); j=1; while(1) { CSD_ScanAllSensors(); CSD_UpdateAllBaselines(); CSD_SCAN();
PRT0DM0 = 0x00; PRT0DM1 = 0xFF; PRT0DM2 = 0xFF; PRT1DM0 = 0x00; PRT1DM1 = 0xFF; PRT1DM2 = 0xFF; PRT2DM0 = 0x00; PRT2DM1 = 0xFF; PRT2DM2 = 0xFF; M8C_EnableIntMask(INT_MSK0, INT_MSK0_SLEEP); M8C_Sleep; } }
void Sleep_Timer_ISR() { M8C_ClearWDTAndSleep; PRT0DM0 = 0x00; PRT0DM1 = 0xFF; PRT0DM2 = 0xFF; PRT1DM0 = 0x60; PRT1DM1 = 0x9F; PRT1DM2 = 0xDF;
PRT2DM0 = 0x20; PRT2DM1 = 0xDF; PRT2DM2 = 0xDF; }
|