X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fprotocol%2Flufa%2Flufa.c;h=9ca55dbc9dc21ed77c175994d9a848d48649f027;hb=d48a4cf1eb80600fb3e8eb859e5b77c954a18137;hp=f03f9a9b929429e1d6b4fbc3aa7783c733f0ecbe;hpb=8b0274f60a47eae523e28b5a7c6c7f581b6d605a;p=qmk_firmware.git diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index f03f9a9b9..9ca55dbc9 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -838,7 +838,10 @@ static void setup_mcu(void) wdt_disable(); /* Disable clock division */ - clock_prescale_set(clock_div_1); + // clock_prescale_set(clock_div_1); + + CLKPR = (1 << CLKPCE); + CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0); } static void setup_usb(void) @@ -883,7 +886,7 @@ int main(void) midi_register_cc_callback(&midi_device, cc_callback); midi_register_sysex_callback(&midi_device, sysex_callback); - init_notes(); + // init_notes(); // midi_send_cc(&midi_device, 0, 1, 2); // midi_send_cc(&midi_device, 15, 1, 0); // midi_send_noteon(&midi_device, 0, 64, 127); @@ -947,10 +950,10 @@ void fallthrough_callback(MidiDevice * device, if (cnt == 3) { switch (byte0 & 0xF0) { case MIDI_NOTEON: - play_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(byte1 & 0x7F)/12.0), (byte2 & 0x7F) / 8); + play_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0), (byte2 & 0x7F) / 8); break; case MIDI_NOTEOFF: - stop_note(((double)261.6)*pow(2.0, -1.0)*pow(2.0,(byte1 & 0x7F)/12.0)); + stop_note(((double)261.6)*pow(2.0, -4.0)*pow(2.0,(byte1 & 0x7F)/12.0)); break; } }