저는 ARM 실험에서 초보자이며이 프로세서의 데이터 개념에 문제가 있습니다. 문제가 발생했습니다. 나는 숫자 "0x80000000에"문제가있는ARM 프로세서의 데이터 저장소
// get the current timer 0 count
unsigned long Timer0_GetTimestamp(void)
{
return T0TC;
}
// check to see if a timestamp is in the past
// returns 1 if in the past, 0 if not
int Timer0_TimestampExpiredCk(unsigned long timestamp)
{
unsigned long now = T0TC;
if (now > timestamp)
{
if ((now - timestamp) < 0x80000000)
return 1;
else
return 0;
}
else
{
if ((timestamp - now) >= 0x80000000)
return 1;
else
return 0;
}
}
// pause for a specific number of milliseconds
void Timer0_Delay(unsigned long milliseconds) {
unsigned long timestamp = Timer0_GetTimestamp() + milliseconds;
while (!Timer0_TimestampExpiredCk(timestamp));
}
: 타이머 간격을 확인하는 코드가있다. 이 숫자를 2의 보수 또는 2 진수로 간주해야합니까? 두 변수의 차이가 0 일 때 우리는 플래그를 변경합니다. 내가 틀렸다면 나를 바로 잡아라.
는
정상적인 C/C++ 코드처럼 보입니다 ... ARM에 특별한 점이 있습니까?(기본 C 질문처럼 보이는 C/C++ 태그 추가) –