Use interrupt-based spi for the display
This solves our "audio stutters while scrolling" problem better! Turns out the real root cause was the polling SPI driver blocking a whole CPU during playback.
This commit is contained in:
@@ -283,7 +283,7 @@ void Display::SendTransaction(TransactionType type,
|
||||
gpio_set_level(kDisplayDr, type);
|
||||
|
||||
// TODO(jacqueline): Handle these errors.
|
||||
esp_err_t ret = spi_device_polling_transmit(handle_, transaction_);
|
||||
esp_err_t ret = spi_device_transmit(handle_, transaction_);
|
||||
ESP_ERROR_CHECK(ret);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -114,8 +114,7 @@ auto Priority<Type::kAudioConverter>() -> UBaseType_t {
|
||||
}
|
||||
// After audio issues, UI jank is the most noticeable kind of scheduling-induced
|
||||
// slowness that the user is likely to notice or care about. Therefore we place
|
||||
// this task directly below audio in terms of priority. Note that during audio
|
||||
// playback, this priority will be downgraded.
|
||||
// this task directly below audio in terms of priority.
|
||||
template <>
|
||||
auto Priority<Type::kUi>() -> UBaseType_t {
|
||||
return 10;
|
||||
|
||||
@@ -49,8 +49,8 @@ class UiState : public tinyfsm::Fsm<UiState> {
|
||||
void react(const tinyfsm::Event& ev) {}
|
||||
|
||||
virtual void react(const system_fsm::BatteryStateChanged&);
|
||||
virtual void react(const audio::PlaybackStarted&);
|
||||
virtual void react(const audio::PlaybackFinished&);
|
||||
virtual void react(const audio::PlaybackStarted&){};
|
||||
virtual void react(const audio::PlaybackFinished&){};
|
||||
virtual void react(const audio::PlaybackUpdate&) {}
|
||||
virtual void react(const audio::QueueUpdate&) {}
|
||||
|
||||
|
||||
@@ -91,13 +91,6 @@ void UiState::react(const system_fsm::BatteryStateChanged&) {
|
||||
UpdateTopBar();
|
||||
}
|
||||
|
||||
void UiState::react(const audio::PlaybackStarted&) {
|
||||
vTaskPrioritySet(NULL, 0);
|
||||
}
|
||||
void UiState::react(const audio::PlaybackFinished&) {
|
||||
vTaskPrioritySet(NULL, 10);
|
||||
}
|
||||
|
||||
void UiState::UpdateTopBar() {
|
||||
auto battery_state = sServices->battery().State();
|
||||
bool has_queue = sServices->track_queue().GetCurrent().has_value();
|
||||
|
||||
Reference in New Issue
Block a user