示例#1
0
void PA_VBL(void){
//  static int heartbeat = 0;
   s32 batt=0;// aux=0;
    int t1=0, t2=0;
    uint32 temp=0;
    uint8 ct[sizeof(IPC->time.curtime)];

    // Update the heartbeat
 //   heartbeat++;
 
    // Read the X/Y buttons and the /PENIRQ line
 /*   but = REG_KEYXY;
    if (!(but & 0x40)) {   //
		PA_UpdateStylus();  // If IPC set correctly
    }*/

    batt = touchRead(TSC_MEASURE_BATTERY);
    
    // Read the time
    rtcGetTimeAndDate((uint8 *)ct);
    //BCDToInteger((uint8 *)&(ct[1]), 7);
    memmove(ct+1, ct, 7);
 
    // Read the temperature
    temp = touchReadTemperature(&t1, &t2);
//    IPC->heartbeat = heartbeat;
  //  IPC->buttons   = but;
    IPC->battery   = batt;
    
    u32 i;
    for(i=0; i<sizeof(ct); i++) {
      IPC->time.curtime[i] = ct[i];
    }

    IPC->temperature = temp;
    IPC->tdiode1 = t1;
    IPC->tdiode2 = t2;
	
	if (PA_NewSPI != (IPC->aux)){
		PA_NewSPI = IPC->aux;
		PA_ScreenLight(); // Update the screen lights...
		//IPC->aux = touchRead(TSC_MEASURE_AUX); // update IPC with new values
	}
			
	SndVblIrq();	// DekuTree64's version
	
	
	PA_IPCManage(); // PAlib IPC functions (sound busy, panning, etc...)
	
	Wifi_Update();
}
示例#2
0
文件: main.c 项目: troy56/palibds
void PA_VBL() {
   s32 batt=0;
    int t1=0, t2=0;
    uint32 temp=0;
    uint8 ct[sizeof(IPC->time.curtime)];

    batt = touchRead(TSC_MEASURE_BATTERY);
    
    // Read the time
    PA_rtcGetTime((uint8 *)ct);
    BCDToInteger((uint8 *)&(ct[1]), 7);
 
    // Read the temperature
    temp = touchReadTemperature(&t1, &t2);
    IPC->battery   = batt;
    
    u32 i;
    for(i=0; i<sizeof(ct); i++) {
      IPC->time.curtime[i] = ct[i];
    }

    IPC->temperature = temp;
    IPC->tdiode1 = t1;
    IPC->tdiode2 = t2;
	
	if (PA_NewSPI != (IPC->aux)){
		PA_NewSPI = IPC->aux;
		PA_ScreenLight(); // Update the screen lights...
	}
	
	AS_SoundVBL();	// Update AS_Lib
	
	PA_IPCManage(); // PAlib IPC functions (sound busy, panning, etc...)
	
	Wifi_Update();
}