Skip to content

Commit

Permalink
fix! no more bugs please
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Jan 31, 2024
1 parent 8706168 commit f76165d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
5 changes: 4 additions & 1 deletion non_catalog_apps/flizzer_tracker/sound_engine/sound_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ void sound_engine_init(
furi_hal_interrupt_set_isr(FuriHalInterruptIdDma1Ch1, NULL, NULL);

furi_hal_interrupt_set_isr_ex(
FuriHalInterruptIdDma1Ch1, 15, sound_engine_dma_isr, sound_engine);
FuriHalInterruptIdDma1Ch1,
FuriHalInterruptPriorityHighest,
sound_engine_dma_isr,
sound_engine);

sound_engine_init_hardware(
sample_rate, external_audio_output, sound_engine->audio_buffer, audio_buffer_size);
Expand Down
21 changes: 13 additions & 8 deletions non_catalog_apps/flizzer_tracker/tracker_engine/tracker_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ void tracker_engine_init(TrackerEngine* tracker_engine, uint8_t rate, SoundEngin
memset(tracker_engine, 0, sizeof(TrackerEngine));

furi_hal_interrupt_set_isr_ex(
FuriHalInterruptIdTIM2, 14, tracker_engine_timer_isr, (void*)tracker_engine);
FuriHalInterruptIdTIM2,
FuriHalInterruptPriorityHighest,
tracker_engine_timer_isr,
(void*)tracker_engine);

tracker_engine_init_hardware(rate);

tracker_engine->sound_engine = sound_engine;
Expand Down Expand Up @@ -38,7 +42,8 @@ void tracker_engine_deinit_song(TrackerSong* song, bool free_song) {
void tracker_engine_deinit(TrackerEngine* tracker_engine, bool free_song) {
tracker_engine_deinit_song(tracker_engine->song, free_song);

furi_hal_interrupt_set_isr_ex(FuriHalInterruptIdTIM2, 13, NULL, NULL);
furi_hal_interrupt_set_isr_ex(
FuriHalInterruptIdTIM2, FuriHalInterruptPriorityHighest, NULL, NULL);
tracker_engine_stop();
}

Expand Down Expand Up @@ -400,9 +405,9 @@ void tracker_engine_advance_channel(TrackerEngine* tracker_engine, uint8_t chan)

else {
te_channel->vibrato_position += ((uint32_t)te_channel->vibrato_speed << 21);
vib =
(int32_t)(sound_engine_triangle(te_channel->vibrato_position >> 9) - WAVE_AMP / 2) *
(int32_t)te_channel->vibrato_depth / (256 * 128);
vib = (int32_t)(sound_engine_triangle(te_channel->vibrato_position >> 9) -
WAVE_AMP / 2) *
(int32_t)te_channel->vibrato_depth / (256 * 128);
}
}

Expand Down Expand Up @@ -437,9 +442,9 @@ void tracker_engine_advance_channel(TrackerEngine* tracker_engine, uint8_t chan)
tracker_engine->sound_engine->channel[chan].pw = tracker_engine->channel[chan].pw;
}

int32_t chn_note =
(int16_t)(te_channel->fixed_note != 0xffff ? te_channel->fixed_note : te_channel->note) +
vib + ((int16_t)te_channel->arpeggio_note << 8);
int32_t chn_note = (int16_t)(te_channel->fixed_note != 0xffff ? te_channel->fixed_note :
te_channel->note) +
vib + ((int16_t)te_channel->arpeggio_note << 8);

if(chn_note < 0) {
chn_note = 0;
Expand Down
6 changes: 4 additions & 2 deletions non_catalog_apps/video_player/video_player_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void player_init_hardware_and_play(VideoPlayerApp* player) {
UNUSED(unu);
}*/

furi_hal_interrupt_set_isr_ex(FuriHalInterruptIdDma1Ch1, 15, video_player_dma_isr, player);
furi_hal_interrupt_set_isr_ex(
FuriHalInterruptIdDma1Ch1, FuriHalInterruptPriorityHighest, video_player_dma_isr, player);

// START!!
LL_TIM_EnableDMAReq_UPDATE(SAMPLE_RATE_TIMER);
Expand All @@ -118,7 +119,8 @@ void player_deinit_hardware() {
}

furi_hal_gpio_init(&gpio_ext_pa6, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
furi_hal_interrupt_set_isr_ex(FuriHalInterruptIdDma1Ch1, 15, NULL, NULL);
furi_hal_interrupt_set_isr_ex(
FuriHalInterruptIdDma1Ch1, FuriHalInterruptPriorityHighest, NULL, NULL);

if(furi_hal_bus_is_enabled(FuriHalBusTIM1)) {
furi_hal_bus_disable(FuriHalBusTIM1);
Expand Down

0 comments on commit f76165d

Please sign in to comment.