Merge branch 'fz-dev' into dev

This commit is contained in:
Eng1n33r
2022-07-20 16:28:48 +03:00
265 changed files with 2576 additions and 3884 deletions

View File

@@ -51,20 +51,20 @@ static int32_t music_player_worker_thread_callback(void* context) {
while(instance->should_work) {
if(NoteBlockArray_end_p(it)) {
NoteBlockArray_it(it, instance->notes);
osDelay(10);
furi_delay_ms(10);
} else {
NoteBlock* note_block = NoteBlockArray_ref(it);
float note_from_a4 = (float)note_block->semitone - NOTE_C4_SEMITONE;
float frequency = NOTE_C4 * powf(TWO_POW_TWELTH_ROOT, note_from_a4);
float duration =
60.0 * osKernelGetTickFreq() * 4 / instance->bpm / note_block->duration;
60.0 * furi_kernel_get_tick_frequency() * 4 / instance->bpm / note_block->duration;
uint32_t dots = note_block->dots;
while(dots > 0) {
duration += duration / 2;
dots--;
}
uint32_t next_tick = furi_hal_get_tick() + duration;
uint32_t next_tick = furi_get_tick() + duration;
float volume = instance->volume;
if(instance->callback) {
@@ -81,7 +81,7 @@ static int32_t music_player_worker_thread_callback(void* context) {
while(instance->should_work && furi_hal_get_tick() < next_tick) {
volume *= 1.0000000;
furi_hal_speaker_set_volume(volume);
furi_hal_delay_ms(2);
furi_delay_ms(2);
}
NoteBlockArray_next(it);
}