void generator_button_play() { generator_paused = generator_paused ? 0 : 1 ; generator_display_refresh(); if (!generator_paused) generate_tone(); }
static void turn_off_beep(struct hda_beep *beep) { cancel_work_sync(&beep->beep_work); if (beep->playing) { /* turn off beep */ generate_tone(beep, 0); } }
static void snd_hda_generate_beep(struct work_struct *work) { struct hda_beep *beep = container_of(work, struct hda_beep, beep_work); if (beep->enabled) generate_tone(beep, beep->tone); }
int main() { printf("Allocating and sampling\n"); uint8_t *buf1=malloc(BUFFER_SIZE); /*alloc_sample_buffer();*/ uint8_t *buf2=malloc(BUFFER_SIZE); /*alloc_sample_buffer();*/ generate_white(buf1,10.,123); write_bin (buf1,"white.bin"); generate_tone(buf2,800.,50.,0.,123); write_bin (buf2,"800MHz.bin"); for (size_t i=0;i<100;i++) { printf ("%i %i %i\n", (int)i,buf1[i],buf2[i]); } return 0; }