΢²¨EDAÍø£¬¼ûÖ¤Ñз¢¹¤³ÌʦµÄ³É³¤£¡
Ê×Ò³ > Ó²¼þÉè¼Æ > ǶÈëʽÉè¼Æ > MSP430ϵͳʵʱʱÖÓRTCѧϰÈÕÖ¾

MSP430ϵͳʵʱʱÖÓRTCѧϰÈÕÖ¾

ʱ¼ä£º11-25 À´Ô´£º»¥ÁªÍø µã»÷£º

//

// ¶ÁÈ¡RTCʱÖÓ //

// //

//

unsigned long GetTime(void)

{

int hour,minute,second ;

unsigned long time ;

for(;RTCCTL01&RTCRDY;) _NOP() ; // µÈ´ýRTCÓÐЧ

for(;!(RTCCTL01&RTCRDY);) _NOP() ;

hour = GetRTCHOUR() ;

minute = GetRTCMIN() ;

second = GetRTCSEC() ;

time = (unsigned long)hour*1000000

+(unsigned long)minute*1000

+(unsigned long)second ;

return time ;

}

Copyright © 2017-2020 ΢²¨EDAÍø °æȨËùÓÐ

ÍøÕ¾µØͼ

Top