mirror of
https://github.com/marqs85/ossc
synced 2025-04-09 22:56:34 +03:00
fix unwanted timer restart
This commit is contained in:
parent
e4cec87bec
commit
7f75717ecb
@ -1235,8 +1235,9 @@ int main()
|
||||
while (alt_timestamp() < start_ts + MAINLOOP_INTERVAL_US*(TIMER_0_FREQ/1000000)) {}
|
||||
|
||||
// restart timer if past half-range
|
||||
if (start_ts > 0x7fffffff) {
|
||||
if ((start_ts > 0x7fffffff) && !SPI_Timer_Status()) {
|
||||
alt_timestamp_start();
|
||||
SPI_Timer_Off();
|
||||
if (auto_input_timestamp > start_ts)
|
||||
auto_input_timestamp -= start_ts;
|
||||
else
|
||||
|
@ -58,8 +58,7 @@ inline void SPI_Freq_Low (void) {
|
||||
|
||||
int SPI_Timer_On (WORD ms) {
|
||||
if (!sd_timer_ts) {
|
||||
sd_timer_ts = ms*(ALT_CPU_FREQ/1000);
|
||||
alt_timestamp_start();
|
||||
sd_timer_ts = alt_timestamp() + ms*(TIMER_0_FREQ/1000);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user