1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Slows timer X, to what may or may not be correct.

This commit is contained in:
Thomas Harte 2021-02-15 16:40:27 -05:00
parent f8f0ff0fae
commit 2a45e7a8d4

View File

@ -801,7 +801,7 @@ inline void Executor::subtract_duration(int duration) {
// Update timer X prescaler. // Update timer X prescaler.
switch(timer_control_ & 0x0c) { switch(timer_control_ & 0x0c) {
default: { default: {
const int tx_ticks = update_timer(prescalers_[1], duration * 4); // Update at 3.58Mhz. const int tx_ticks = update_timer(prescalers_[1], t12_ticks); // TODO: don't hard code this. And is this even right?
if(update_timer(timers_[2], tx_ticks)) if(update_timer(timers_[2], tx_ticks))
timer_control_ |= 0x80; // TODO: interrupt result of this. timer_control_ |= 0x80; // TODO: interrupt result of this.
} break; } break;
@ -815,7 +815,6 @@ inline void Executor::subtract_duration(int duration) {
LOG("TODO: Timer X; Pulse width measurement mode"); LOG("TODO: Timer X; Pulse width measurement mode");
break; break;
} }
// update_timer(timers_[2], update_timer(prescalers_[1], duration));
} }
inline int Executor::update_timer(Timer &timer, int count) { inline int Executor::update_timer(Timer &timer, int count) {