diff --git a/MicroDexed.ino b/MicroDexed.ino index 0a80b29..e5ae1a2 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -31,8 +31,6 @@ #include #include #include -#include -using namespace TeensyTimerTool; #include "midi_devices.hpp" #include "synth_dexed.h" #include "dexed_sd.h" @@ -2630,25 +2628,25 @@ FLASHMEM uint8_t check_sd_cards(void) #endif switch (card.type()) { case SD_CARD_TYPE_SD1: - snprintf_P(sd_string, strlen(sd_string), PSTR("%-5s"), PSTR("SD1")); + snprintf_P(sd_string, sizeof(sd_string), PSTR("%-5s"), PSTR("SD1")); #ifdef DEBUG Serial.println(F("SD1")); #endif break; case SD_CARD_TYPE_SD2: - snprintf_P(sd_string, strlen(sd_string), PSTR("%-5s"), PSTR("SD2")); + snprintf_P(sd_string, sizeof(sd_string), PSTR("%-5s"), PSTR("SD2")); #ifdef DEBUG Serial.println(F("SD2")); #endif break; case SD_CARD_TYPE_SDHC: - snprintf_P(sd_string, strlen(sd_string), PSTR("%-5s"), PSTR("SD2")); + snprintf_P(sd_string, sizeof(sd_string), PSTR("%-5s"), PSTR("SD2")); #ifdef DEBUG Serial.println(F("SDHC")); #endif break; default: - snprintf_P(sd_string, strlen(sd_string), PSTR("%-5s"), PSTR("UKNW")); + snprintf_P(sd_string, sizeof(sd_string), PSTR("%-5s"), PSTR("UKNW")); #ifdef DEBUG Serial.println(F("Unknown")); #endif @@ -2679,7 +2677,7 @@ FLASHMEM uint8_t check_sd_cards(void) Serial.println(volumesize); #endif - snprintf_P(sd_string + 5, strlen(sd_string), PSTR("FAT%2d %02dGB"), volume.fatType(), int(volumesize)); + snprintf_P(sd_string + 5, sizeof(sd_string), PSTR("FAT%2d %02dGB"), volume.fatType(), int(volumesize)); } #ifdef DEBUG @@ -2702,7 +2700,7 @@ FLASHMEM void check_and_create_directories(void) // create directories for banks for (i = 0; i < MAX_BANKS; i++) { - snprintf_P(tmp, strlen(tmp), PSTR("/%d"), i); + snprintf_P(tmp, sizeof(tmp), PSTR("/%d"), i); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2713,7 +2711,7 @@ FLASHMEM void check_and_create_directories(void) } } - snprintf_P(tmp, strlen(tmp), PSTR("/%s"), PERFORMANCE_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s"), PERFORMANCE_CONFIG_PATH); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2725,7 +2723,7 @@ FLASHMEM void check_and_create_directories(void) /* // create directories for configuration files - snprintf_P(tmp, strlen(tmp), PSTR("/%s"), VOICE_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s"), VOICE_CONFIG_PATH); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2734,7 +2732,7 @@ FLASHMEM void check_and_create_directories(void) #endif SD.mkdir(tmp); } - snprintf_P(tmp, strlen(tmp), PSTR("/%s"), PERFORMANCE_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s"), PERFORMANCE_CONFIG_PATH); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2743,7 +2741,7 @@ FLASHMEM void check_and_create_directories(void) #endif SD.mkdir(tmp); } - snprintf_P(tmp, strlen(tmp), PSTR("/%s"), FX_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s"), FX_CONFIG_PATH); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2752,7 +2750,7 @@ FLASHMEM void check_and_create_directories(void) #endif SD.mkdir(tmp); } - snprintf_P(tmp, strlen(tmp), PSTR("/%s"), DRUM_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s"), DRUM_CONFIG_PATH); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2761,7 +2759,7 @@ FLASHMEM void check_and_create_directories(void) #endif SD.mkdir(tmp); } - snprintf_P(tmp, strlen(tmp), PSTR("/%s"), FAV_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s"), FAV_CONFIG_PATH); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2772,7 +2770,7 @@ FLASHMEM void check_and_create_directories(void) } */ - snprintf_P(tmp, strlen(tmp), PSTR("/%s"), PERFORMANCE_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s"), PERFORMANCE_CONFIG_PATH); if (!SD.exists(tmp)) { #ifdef DEBUG @@ -2783,14 +2781,14 @@ FLASHMEM void check_and_create_directories(void) } //check if updated Fav-System is ready or if setup has to run once. - snprintf_P(tmp, strlen(tmp), PSTR("/%s/fav-v2"), FAV_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/fav-v2"), FAV_CONFIG_PATH); if (!SD.exists(tmp)) { // Clear now obsolte marker files from Favs. // Only needs to run once. for (uint8_t i = 0; i < MAX_BANKS; i++) { - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d/hasfav"), FAV_CONFIG_PATH, i); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/hasfav"), FAV_CONFIG_PATH, i); #ifdef DEBUG Serial.print(F("Delete Marker File")); Serial.println(tmp); @@ -2802,7 +2800,7 @@ FLASHMEM void check_and_create_directories(void) // Only needs to run once. for (uint8_t i = 0; i < MAX_BANKS; i++) { - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, i); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, i); #ifdef DEBUG Serial.print(F("Delete empty folder ")); Serial.println(tmp); @@ -2810,7 +2808,7 @@ FLASHMEM void check_and_create_directories(void) if (SD.exists(tmp)) SD.rmdir(tmp); } - snprintf_P(tmp, strlen(tmp), PSTR("/%s/fav-v2"), FAV_CONFIG_PATH); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/fav-v2"), FAV_CONFIG_PATH); if (!SD.exists(tmp)) SD.mkdir(tmp); // Set Marker so that the Cleanup loops only run once. } @@ -3087,7 +3085,7 @@ void SerialPrintFormatInt3(uint8_t num) { char buf[4]; memset(buf, 0, 4); - snprintf_P(buf, strlen(buf), PSTR("%3d"), num); + snprintf_P(buf, sizeof(buf), PSTR("%3d"), num); Serial.print(buf); } diff --git a/UI.hpp b/UI.hpp index 61b659d..b352aa5 100644 --- a/UI.hpp +++ b/UI.hpp @@ -1914,7 +1914,7 @@ void getNoteName(char* noteName, uint8_t noteNumber) uint8_t oct_index = noteNumber - 12; noteNumber -= 21; - snprintf_P(noteName, strlen(noteName), PSTR("%2s%1d"), notes[noteNumber % 12], oct_index / 12); + snprintf_P(noteName, sizeof(noteName), PSTR("%2s%1d"), notes[noteNumber % 12], oct_index / 12); } void UI_func_lowest_note(uint8_t param) @@ -4362,7 +4362,7 @@ void UI_func_drum_reverb_send(uint8_t param) display.setCursor(0, 0); display.print("Drum Rev. Send"); display.setCursor(1, 1); - snprintf_P(displayname, strlen(displayname), PSTR("%02d"), activesample); + snprintf_P(displayname, sizeof(displayname), PSTR("%02d"), activesample); display.print(displayname); display.show(4, 5, 6, basename(drum_config[activesample].name)); } @@ -4388,7 +4388,7 @@ void UI_func_drum_reverb_send(uint8_t param) display.print("["); display.setCursor(15, 1); display.print("]"); - snprintf_P(displayname, strlen(displayname), PSTR("%03d"), temp_int); + snprintf_P(displayname, sizeof(displayname), PSTR("%03d"), temp_int); display.setCursor(12, 1); display.print(displayname); drum_config[activesample].reverb_send = mapfloat(temp_int, 0, 100, 0.0, 1.0); @@ -4453,7 +4453,7 @@ void UI_func_drums_main_volume(uint8_t param) } } display.setCursor(5, 1); - snprintf_P(displayname, strlen(displayname), PSTR("%03d"), temp_int); + snprintf_P(displayname, sizeof(displayname), PSTR("%03d"), temp_int); display.print(displayname); display.setCursor(8, 1); display.print("/100"); @@ -4478,7 +4478,7 @@ void UI_func_drum_tune_offset(uint8_t param) display.print("DrumSmp. Tune"); display.setCursor(1, 1); display.setCursor(1, 1); - snprintf_P(displayname, strlen(displayname), PSTR("%02d"), activesample); + snprintf_P(displayname, sizeof(displayname), PSTR("%02d"), activesample); display.print(displayname); display.show(1, 4, 7, basename(drum_config[activesample].name)); @@ -4508,7 +4508,7 @@ void UI_func_drum_tune_offset(uint8_t param) display.print("["); display.setCursor(15, 1); display.print("]"); - snprintf_P(displayname, strlen(displayname), PSTR("%03d"), temp_int); + snprintf_P(displayname, sizeof(displayname), PSTR("%03d"), temp_int); display.setCursor(12, 1); display.print(displayname); drum_config[activesample].p_offset = temp_float; @@ -4530,7 +4530,7 @@ void UI_func_drum_pitch(uint8_t param) display.print("DrumSmp. Pitch"); display.setCursor(1, 1); display.setCursor(1, 1); - snprintf_P(displayname, strlen(displayname), PSTR("%02d"), activesample); + snprintf_P(displayname, sizeof(displayname), PSTR("%02d"), activesample); display.print(displayname); display.show(1, 4, 7, basename(drum_config[activesample].name)); @@ -4558,7 +4558,7 @@ void UI_func_drum_pitch(uint8_t param) display.print("["); display.setCursor(15, 1); display.print("]"); - snprintf_P(displayname, strlen(displayname), PSTR("%03d"), temp_int); + snprintf_P(displayname, sizeof(displayname), PSTR("%03d"), temp_int); display.setCursor(12, 1); display.print(displayname); drum_config[activesample].pitch = temp_float; @@ -4581,7 +4581,7 @@ void UI_func_drum_volume(uint8_t param) display.print("DrumSmp. Volume"); display.setCursor(1, 1); display.setCursor(1, 1); - snprintf_P(displayname, strlen(displayname), PSTR("%02d"), activesample); + snprintf_P(displayname, sizeof(displayname), PSTR("%02d"), activesample); display.print(displayname); display.show(1, 4, 7, basename(drum_config[activesample].name)); @@ -4597,7 +4597,7 @@ void UI_func_drum_volume(uint8_t param) display.print("["); display.setCursor(15, 1); display.print("]"); - snprintf_P(displayname, strlen(displayname), PSTR("%03d"), temp_int); + snprintf_P(displayname, sizeof(displayname), PSTR("%03d"), temp_int); display.setCursor(12, 1); display.print(displayname); drum_config[activesample].vol_max = temp_float; @@ -4619,7 +4619,7 @@ void UI_func_drum_pan(uint8_t param) display.setCursor(0, 0); display.print("DrmSmp. Panorama"); display.setCursor(1, 1); - snprintf_P(displayname, strlen(displayname), PSTR("%02d"), activesample); + snprintf_P(displayname, sizeof(displayname), PSTR("%02d"), activesample); display.print(displayname); display.show(1, 4, 6, basename(drum_config[activesample].name)); } @@ -4659,7 +4659,7 @@ void UI_func_drum_pan(uint8_t param) else { display.print("C"); } - snprintf_P(displayname, strlen(displayname), PSTR("%02d"), abs(temp_int)); + snprintf_P(displayname, sizeof(displayname), PSTR("%02d"), abs(temp_int)); display.setCursor(13, 1); display.print( displayname); } @@ -4685,9 +4685,9 @@ void UI_func_save_performance(uint8_t param) display.setCursor(0, 0); display.print(F("Save Performance")); display.setCursor(0, 1); - snprintf_P(tmp, strlen(tmp), PSTR("[%2d]"), temp_int); + snprintf_P(tmp, sizeof(tmp), PSTR("[%2d]"), temp_int); display.print(tmp); - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, temp_int, PERFORMANCE_CONFIG_NAME); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, temp_int, PERFORMANCE_CONFIG_NAME); if (SD.exists(tmp)) overwrite = true; else @@ -4742,7 +4742,7 @@ void UI_func_save_performance(uint8_t param) mode = 0; display.setCursor(0, 1); - snprintf_P(tmp, strlen(tmp), PSTR("[%2d] "), temp_int); + snprintf_P(tmp, sizeof(tmp), PSTR("[%2d] "), temp_int); display.print(tmp); } } @@ -4750,7 +4750,7 @@ void UI_func_save_performance(uint8_t param) if (mode == 0) { char tmp[CONFIG_FILENAME_LEN]; - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, temp_int, PERFORMANCE_CONFIG_NAME); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, temp_int, PERFORMANCE_CONFIG_NAME); if (SD.exists(tmp)) overwrite = true; @@ -4758,7 +4758,7 @@ void UI_func_save_performance(uint8_t param) overwrite = false; display.setCursor(0, 1); - snprintf_P(tmp, strlen(tmp), PSTR("[%2d]"), temp_int); + snprintf_P(tmp, sizeof(tmp), PSTR("[%2d]"), temp_int); display.print(tmp); display.setCursor(5, 1); if (overwrite == false) { @@ -4812,7 +4812,7 @@ void UI_func_load_performance(uint8_t param) display.setCursor(0, 0); display.print(F("Load Performance ")); display.setCursor(0, 1); - snprintf_P(tmp, strlen(tmp), PSTR("[%2d]"), param); + snprintf_P(tmp, sizeof(tmp), PSTR("[%2d]"), param); display.print(tmp); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -4844,7 +4844,7 @@ void UI_func_load_performance(uint8_t param) } display.setCursor(0, 1); char tmp[10]; - snprintf_P(tmp, strlen(tmp), PSTR("[%2d]"), temp_int); + snprintf_P(tmp, sizeof(tmp), PSTR("[%2d]"), temp_int); display.print(tmp); if (check_sd_performance_exists(temp_int)) { @@ -5275,7 +5275,7 @@ void UI_func_volume(uint8_t param) display.setCursor(0, 1); display.print("Attack = "); display.setCursor(13, 1); - snprintf_P(tmp, strlen(tmp), PSTR("%03d"), perform_attack_mod[selected_instance_id]); + snprintf_P(tmp, sizeof(tmp), PSTR("%03d"), perform_attack_mod[selected_instance_id]); display.print(tmp); back_from_volume = 0; } @@ -5287,7 +5287,7 @@ void UI_func_volume(uint8_t param) display.setCursor(11, 1); display.print("Release = "); display.setCursor(13, 1); - snprintf_P(tmp, strlen(tmp), PSTR("%03d"), perform_release_mod[selected_instance_id]); + snprintf_P(tmp, sizeof(tmp), PSTR("%03d"), perform_release_mod[selected_instance_id]); display.print(tmp); back_from_volume = 0; } @@ -5400,7 +5400,7 @@ void UI_func_volume(uint8_t param) display.setCursor(0, 1); display.print("Attack = "); display.setCursor(13, 1); - snprintf_P(tmp, strlen(tmp), PSTR("%03d"), perform_attack_mod[selected_instance_id]); + snprintf_P(tmp, sizeof(tmp), PSTR("%03d"), perform_attack_mod[selected_instance_id]); display.print(tmp); back_from_volume = 0; } @@ -5410,7 +5410,7 @@ void UI_func_volume(uint8_t param) display.setCursor(0, 1); display.print("Release = "); display.setCursor(13, 1); - snprintf_P(tmp, strlen(tmp), PSTR("%03d"), perform_release_mod[selected_instance_id]); + snprintf_P(tmp, sizeof(tmp), PSTR("%03d"), perform_release_mod[selected_instance_id]); display.print(tmp); back_from_volume = 0; } @@ -5720,7 +5720,7 @@ void UI_func_sysex_receive_bank(uint8_t param) #endif char tmp[CONFIG_FILENAME_LEN]; strcpy(tmp, receive_bank_filename); - snprintf_P(receive_bank_filename, strlen(receive_bank_filename), PSTR("/%d/%s.syx"), bank_number, tmp); + snprintf_P(receive_bank_filename, sizeof(receive_bank_filename), PSTR("/%d/%s.syx"), bank_number, tmp); #ifdef DEBUG Serial.print(F("Receiving into bank ")); Serial.print(bank_number); @@ -5878,7 +5878,7 @@ void UI_func_sysex_send_bank(uint8_t param) if (get_bank_name(bank_number, bank_name, sizeof(bank_name))) { - snprintf_P(filename, strlen(filename), PSTR("/%d/%s.syx"), bank_number, bank_name); + snprintf_P(filename, sizeof(filename), PSTR("/%d/%s.syx"), bank_number, bank_name); #ifdef DEBUG Serial.print(F("Send bank ")); Serial.print(filename); @@ -6022,7 +6022,7 @@ void UI_func_sysex_send_voice(uint8_t param) if (get_bank_name(bank_number, bank_name, sizeof(bank_name))) { - snprintf_P(filename, strlen(filename), PSTR("/%d/%s.syx"), bank_number, bank_name); + snprintf_P(filename, sizeof(filename), PSTR("/%d/%s.syx"), bank_number, bank_name); #ifdef DEBUG Serial.print(F("Send voice ")); Serial.print(voice_number); @@ -6710,24 +6710,24 @@ void display_float(float var, uint8_t size_number, uint8_t size_fraction, bool z if (size_fraction > 0) { if (zeros == true && sign == true) - snprintf_P(s, strlen(s), PSTR("%+0*.*f"), size_number + size_fraction + 2, size_fraction, var); + snprintf_P(s, sizeof(s), PSTR("%+0*.*f"), size_number + size_fraction + 2, size_fraction, var); else if (zeros == true && sign == false) - snprintf_P(s, strlen(s), PSTR("%0*.*f"), size_number + size_fraction + 1, size_fraction, var); + snprintf_P(s, sizeof(s), PSTR("%0*.*f"), size_number + size_fraction + 1, size_fraction, var); else if (zeros == false && sign == true) - snprintf_P(s, strlen(s), PSTR("%+*.*f"), size_number + size_fraction + 2, size_fraction, var); + snprintf_P(s, sizeof(s), PSTR("%+*.*f"), size_number + size_fraction + 2, size_fraction, var); else if (zeros == false && sign == false) - snprintf_P(s, strlen(s), PSTR("%*.*f"), size_number + size_fraction + 1, size_fraction, var); + snprintf_P(s, sizeof(s), PSTR("%*.*f"), size_number + size_fraction + 1, size_fraction, var); } else { if (zeros == true && sign == true) - snprintf_P(s, strlen(s), PSTR("%+0*d"), size_number + 1, var); + snprintf_P(s, sizeof(s), PSTR("%+0*d"), size_number + 1, int(var)); else if (zeros == true && sign == false) - snprintf_P(s, strlen(s), PSTR("%0*d"), size_number, var); + snprintf_P(s, sizeof(s), PSTR("%0*d"), size_number, int(var)); else if (zeros == false && sign == true) - snprintf_P(s, strlen(s), PSTR("%+*d"), size_number + 1, var); + snprintf_P(s, sizeof(s), PSTR("%+*d"), size_number + 1, int(var)); else if (zeros == false && sign == false) - snprintf_P(s, strlen(s), PSTR("%*d"), size_number, var); + snprintf_P(s, sizeof(s), PSTR("%*d"), size_number, int(var)); } if (brackets == true) @@ -6735,7 +6735,7 @@ void display_float(float var, uint8_t size_number, uint8_t size_fraction, bool z char tmp[LCD_cols + 1]; strcpy(tmp, s); - snprintf_P(s, strlen(s), PSTR("[%s]"), tmp); + snprintf_P(s, sizeof(s), PSTR("[%s]"), tmp); } Serial.println(var); @@ -6773,15 +6773,14 @@ void display_bar_float(const char* title, float value, float factor, int32_t min // Title if (init == true) - display.show(0, 0, LCD_cols - 2, title); - //display.show(0, 0, LCD_cols - 3, title); + display.show(0, 0, LCD_cols - 3, title); // Value display.setCursor(LCD_cols - size, 1); - //display_float(value * factor, size_number, size_fraction, zeros, false, sign); // does not work with "Smallest code" optimizer - char s[LCD_cols + 1]; - snprintf_P(s, strlen(s), PSTR("%+1.1f"), value * factor); // not so good solution, but works with optimizer - display.print(s); + display_float(value * factor, size_number, size_fraction, zeros, false, sign); // does not work with "Smallest code" optimizer + /* char s[LCD_cols + 1]; + snprintf_P(s, sizeof(s), PSTR("%+1.1f"), value * factor); // not so good solution, but works with optimizer + display.print(s); */ // Bar display.setCursor(0, 1); @@ -6836,10 +6835,10 @@ void display_meter_float(const char* title, float value, float factor, float off // Value display.setCursor(LCD_cols - size, 1); - //display_float((value + offset) * factor, size_number, size_fraction, zeros, false, sign); // does not work with "Smallest code" optimizer - char s[LCD_cols + 1]; - snprintf_P(s, strlen(s), PSTR("%+1.1f"), (value + offset) * factor); // not so good solution, but works with optimizer - display.print(s); + display_float((value + offset) * factor, size_number, size_fraction, zeros, false, sign); // does not work with "Smallest code" optimizer + /* char s[LCD_cols + 1]; + snprintf_P(s, sizeof(s), PSTR("%+1.1f"), (value + offset) * factor); // not so good solution, but works with optimizer + display.print(s); */ // Bar display.setCursor(0, 1); @@ -7286,7 +7285,7 @@ bool check_favorite(uint8_t b, uint8_t v, uint8_t instance_id) File myFav; if (sd_card > 0) { - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); #ifdef DEBUG Serial.print("check if Voice is a Favorite: "); Serial.print(tmp); @@ -7320,7 +7319,7 @@ void draw_favorite_icon(uint8_t b, uint8_t v, uint8_t instance_id) File myFav; if (sd_card > 0) { - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); if (SD.exists(tmp)) { //is Favorite #ifdef TESTDISPLAY20x4 @@ -7349,7 +7348,7 @@ bool quick_check_favorites_in_bank(uint8_t b, uint8_t instance_id) if (sd_card > 0) { - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); #ifdef DEBUG Serial.print("check if there is a Favorite in Bank: "); Serial.print(tmp); @@ -7387,8 +7386,8 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) uint8_t i = 0, countfavs = 0; if (sd_card > 0) { - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); - snprintf_P(tmpfolder, strlen(tmpfolder), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, v); + snprintf_P(tmpfolder, sizeof(tmpfolder), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); #ifdef DEBUG Serial.println("Save Favorite to SD card..."); Serial.println(tmp); @@ -7419,11 +7418,11 @@ void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id) Serial.println("Removed from Favorites..."); #endif for (i = 0; i < 32; i++) { //if no other favs exist in current bank, remove folder - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, i); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d/%d.fav"), FAV_CONFIG_PATH, b, i); if (SD.exists(tmp)) countfavs++; } if (countfavs == 0) { - snprintf_P(tmp, strlen(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); + snprintf_P(tmp, sizeof(tmp), PSTR("/%s/%d"), FAV_CONFIG_PATH, b); SD.rmdir(tmp); #ifdef DEBUG Serial.println("Fav count in bank:"); diff --git a/dexed_sd.cpp b/dexed_sd.cpp index bad4255..515464d 100644 --- a/dexed_sd.cpp +++ b/dexed_sd.cpp @@ -29,8 +29,6 @@ #include #include #include -#include -using namespace TeensyTimerTool; #include "dexed_sd.h" #include "synth_dexed.h" #if NUM_DRUMS > 0 @@ -83,7 +81,7 @@ bool load_sd_voice(uint8_t b, uint8_t v, uint8_t instance_id) uint8_t data[128]; get_bank_name(b, bank_name, sizeof(bank_name)); - snprintf_P(filename, strlen(filename), PSTR("/%d/%s.syx"), b, bank_name); + snprintf_P(filename, sizeof(filename), PSTR("/%d/%s.syx"), b, bank_name); AudioNoInterrupts(); sysex = SD.open(filename); @@ -154,7 +152,7 @@ bool save_sd_voice(uint8_t b, uint8_t v, uint8_t instance_id) uint8_t data[128]; get_bank_name(b, bank_name, sizeof(bank_name)); - snprintf_P(filename, strlen(filename), PSTR("/%d/%s.syx"), b, bank_name); + snprintf_P(filename, sizeof(filename), PSTR("/%d/%s.syx"), b, bank_name); AudioNoInterrupts(); sysex = SD.open(filename, FILE_WRITE); @@ -369,7 +367,7 @@ bool save_sd_bank(const char* bank_filename, uint8_t* data) // first remove old bank sscanf(bank_filename, "/%d/%s", &bank_number, tmp); - snprintf_P(tmp, strlen(tmp), PSTR("/%d"), bank_number); + snprintf_P(tmp, sizeof(tmp), PSTR("/%d"), bank_number); AudioNoInterrupts(); root = SD.open(tmp); while (42 == 42) @@ -385,7 +383,7 @@ bool save_sd_bank(const char* bank_filename, uint8_t* data) Serial.print(F("/")); Serial.println(entry.name()); #endif - snprintf_P(tmp2, strlen(tmp2), PSTR("%s/%s"), tmp, entry.name()); + snprintf_P(tmp2, sizeof(tmp2), PSTR("%s/%s"), tmp, entry.name()); entry.close(); #ifndef DEBUG SD.remove(tmp2); @@ -444,7 +442,7 @@ bool load_sd_drumsettings_json(uint8_t number) StaticJsonDocument data_json; char filename[CONFIG_FILENAME_LEN]; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, DRUMS_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, DRUMS_CONFIG_NAME); // first check if file exists... AudioNoInterrupts(); @@ -518,7 +516,7 @@ bool save_sd_drumsettings_json(uint8_t number) if (check_performance_directory(number)) { - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, DRUMS_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, DRUMS_CONFIG_NAME); #ifdef DEBUG Serial.print(F("Saving drums config ")); @@ -598,7 +596,7 @@ bool load_sd_voiceconfig_json(uint8_t vc, uint8_t instance_id) File json; StaticJsonDocument data_json; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s%d.json"), PERFORMANCE_CONFIG_PATH, vc, VOICE_CONFIG_NAME, instance_id + 1); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s%d.json"), PERFORMANCE_CONFIG_PATH, vc, VOICE_CONFIG_NAME, instance_id + 1); // first check if file exists... AudioNoInterrupts(); @@ -691,7 +689,7 @@ bool save_sd_voiceconfig_json(uint8_t vc, uint8_t instance_id) { File json; StaticJsonDocument data_json; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s%d.json"), PERFORMANCE_CONFIG_PATH, vc, VOICE_CONFIG_NAME, instance_id + 1); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s%d.json"), PERFORMANCE_CONFIG_PATH, vc, VOICE_CONFIG_NAME, instance_id + 1); #ifdef DEBUG Serial.print(F("Saving voice config ")); @@ -782,7 +780,7 @@ bool load_sd_fx_json(uint8_t number) File json; StaticJsonDocument data_json; char filename[CONFIG_FILENAME_LEN]; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, FX_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, FX_CONFIG_NAME); // first check if file exists... AudioNoInterrupts(); @@ -882,7 +880,7 @@ bool save_sd_fx_json(uint8_t number) { File json; StaticJsonDocument data_json; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, FX_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, FX_CONFIG_NAME); #ifdef DEBUG Serial.print(F("Saving fx config ")); @@ -968,7 +966,7 @@ bool load_sd_epiano_json(uint8_t number) File json; StaticJsonDocument data_json; char filename[CONFIG_FILENAME_LEN]; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, EPIANO_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, EPIANO_CONFIG_NAME); // first check if file exists... AudioNoInterrupts(); @@ -1048,7 +1046,7 @@ bool save_sd_epiano_json(uint8_t number) { File json; StaticJsonDocument data_json; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, EPIANO_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, EPIANO_CONFIG_NAME); #ifdef DEBUG Serial.print(F("Saving epiano config ")); @@ -1117,7 +1115,7 @@ bool load_sd_sys_json(void) File json; StaticJsonDocument data_json; char filename[CONFIG_FILENAME_LEN]; - snprintf_P(filename, strlen(filename), PSTR("/%s.json"), SYS_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s.json"), SYS_CONFIG_NAME); // first check if file exists... AudioNoInterrupts(); @@ -1182,7 +1180,7 @@ bool save_sd_sys_json(void) { File json; StaticJsonDocument data_json; - snprintf_P(filename, strlen(filename), PSTR("/%s.json"), SYS_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s.json"), SYS_CONFIG_NAME); #ifdef DEBUG Serial.print(F("Saving sys config to ")); @@ -1249,7 +1247,7 @@ bool save_sd_performance_json(uint8_t number) for (uint8_t i = 0; i < MAX_DEXED; i++) { - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s%d.json"), PERFORMANCE_CONFIG_PATH, number, VOICE_CONFIG_NAME, i); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s%d.json"), PERFORMANCE_CONFIG_PATH, number, VOICE_CONFIG_NAME, i); #ifdef DEBUG Serial.print(F("Write Voice-Config")); Serial.println(filename); @@ -1261,7 +1259,7 @@ bool save_sd_performance_json(uint8_t number) { File json; StaticJsonDocument data_json; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); #ifdef DEBUG Serial.print(F("Saving performance config ")); Serial.print(number); @@ -1309,7 +1307,7 @@ bool check_performance_directory(uint8_t number) if (sd_card > 0) { - snprintf_P(dir, strlen(dir), PSTR("/%s/%d"), PERFORMANCE_CONFIG_PATH, number); + snprintf_P(dir, sizeof(dir), PSTR("/%s/%d"), PERFORMANCE_CONFIG_PATH, number); AudioNoInterrupts(); SD.begin(); @@ -1353,7 +1351,7 @@ void get_sd_performance_name_json(uint8_t number) StaticJsonDocument data_json; char filename[CONFIG_FILENAME_LEN]; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); // first check if file exists... AudioNoInterrupts(); @@ -1439,7 +1437,7 @@ bool check_sd_performance_exists(uint8_t number) { char filename[CONFIG_FILENAME_LEN]; - snprintf_P(filename, strlen(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); + snprintf_P(filename, sizeof(filename), PSTR("/%s/%d/%s.json"), PERFORMANCE_CONFIG_PATH, number, PERFORMANCE_CONFIG_NAME); // check if file exists... if (SD.exists(filename)) @@ -1647,7 +1645,7 @@ bool get_bank_name(uint8_t b, char* name, uint8_t len) memset(name, 0, len); - snprintf_P(bankdir, strlen(bankdir), PSTR("/%d"), b); + snprintf_P(bankdir, sizeof(bankdir), PSTR("/%d"), b); // try to open directory sysex = SD.open(bankdir); @@ -1698,7 +1696,7 @@ bool get_voice_name(uint8_t b, uint8_t v, char* name, uint8_t len) v = constrain(v, 0, MAX_VOICES - 1); get_bank_name(b, bank_name, sizeof(bank_name)); - snprintf_P(filename, strlen(filename), PSTR("/%d/%s.syx"), b, bank_name); + snprintf_P(filename, sizeof(filename), PSTR("/%d/%s.syx"), b, bank_name); #ifdef DEBUG Serial.print(F("Reading voice-name from [")); Serial.print(filename); @@ -1742,7 +1740,7 @@ bool get_voice_by_bank_name(uint8_t b, const char* bank_name, uint8_t v, char* v { char filename[FILENAME_LEN]; - snprintf_P(filename, strlen(filename), PSTR("/%d/%s.syx"), b, bank_name); + snprintf_P(filename, sizeof(filename), PSTR("/%d/%s.syx"), b, bank_name); #ifdef DEBUG Serial.print(F("Reading voice-name from [")); Serial.print(filename); diff --git a/third-party/TeensyTimerTool/LICENSE b/third-party/TeensyTimerTool/LICENSE deleted file mode 100644 index 00b7427..0000000 --- a/third-party/TeensyTimerTool/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Lutz Niggl - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/third-party/TeensyTimerTool/README.md b/third-party/TeensyTimerTool/README.md deleted file mode 100644 index 0202484..0000000 --- a/third-party/TeensyTimerTool/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# TeensyTimerTool - -The TeensyTimerTool is a library that provides a generic, easy to use interface to the hardware timers of the PJRC Teensy boards. In addition, it provides up to 20 highly efficient software timers that use the same interface. All timers can be used in periodic and one-shot mode. Currently the library supports the ARM T3.X and T4.0 boards. - -- This way to the corresponding PJRC **[forum post](https://forum.pjrc.com/threads/59112-TeensyTimerTool)** -- This way to the documentation in the **[TeensyTimerTool WIKI](https://github.com/luni64/TeensyTimerTool/wiki)** - diff --git a/third-party/TeensyTimerTool/assets/FTM0_8CH.jpg b/third-party/TeensyTimerTool/assets/FTM0_8CH.jpg deleted file mode 100644 index 077c650..0000000 Binary files a/third-party/TeensyTimerTool/assets/FTM0_8CH.jpg and /dev/null differ diff --git a/third-party/TeensyTimerTool/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino b/third-party/TeensyTimerTool/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino deleted file mode 100644 index 9b20e26..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino +++ /dev/null @@ -1,31 +0,0 @@ -#include "TeensyTimerTool.h" -using namespace TeensyTimerTool; - - - -//Timer t[]{FTM0, FTM0, FTM2}; // two channels from FTM0, one from FTM2 -//Timer t[3]; // use 3 timers from the pool -OneShotTimer t[]{FTM0, FTM0, FTM0, FTM0, FTM0, FTM0, FTM0, FTM0}; // all 8 channels of FTM0 - -constexpr unsigned nrOfTimers = sizeof(t) / sizeof(t[0]); - -void setup() -{ - // setup timers, use lambdas as callbacks - for (unsigned i = 0; i < nrOfTimers; i++) - { - pinMode(i, OUTPUT); - t[i].begin([i] { digitalWriteFast(i, LOW); }); // callback resets pin to LOW - } -} - - -void loop() -{ - for (unsigned i = 0; i < nrOfTimers; i++) - { - digitalWriteFast(i, HIGH); - t[i].trigger(50 * (i + 1)); // 50, 100, 150 ... µs - } - delay(1); -} diff --git a/third-party/TeensyTimerTool/examples/01_Basic/ArrayOfTimers/README.md b/third-party/TeensyTimerTool/examples/01_Basic/ArrayOfTimers/README.md deleted file mode 100644 index 2ee08f0..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/ArrayOfTimers/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Measured output of the example sketch - -![Output](./../../assets/FTM0_8CH.jpg) \ No newline at end of file diff --git a/third-party/TeensyTimerTool/examples/01_Basic/HelloOneShot/HelloOneShot.ino b/third-party/TeensyTimerTool/examples/01_Basic/HelloOneShot/HelloOneShot.ino deleted file mode 100644 index f11fa1d..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/HelloOneShot/HelloOneShot.ino +++ /dev/null @@ -1,26 +0,0 @@ -#include "Arduino.h" -#include "TeensyTimerTool.h" - -using namespace TeensyTimerTool; - -void callback() -{ - digitalWriteFast(LED_BUILTIN, LOW); // switch off LED -} - - -OneShotTimer timer1; // generate a timer from the pool (Pool: 2xGPT, 16xTMR(QUAD), 20xTCK) - -void setup() -{ - pinMode(LED_BUILTIN,OUTPUT); - timer1.begin(callback); -} - -void loop() -{ - digitalWriteFast(LED_BUILTIN, HIGH); - timer1.trigger(10'000); // switch of after 10ms - - delay(500); -} diff --git a/third-party/TeensyTimerTool/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino b/third-party/TeensyTimerTool/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino deleted file mode 100644 index e4ecc97..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************** - * Basic usage of the timer - * - * Generates a timer from the timer pool and - * starts it with a period of 250ms. - * The timer callback simply toggles the built in LED - * - ********************************************************/ - -#include "TeensyTimerTool.h" - -using namespace TeensyTimerTool; - -void callback() -{ - digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN)); -} - -PeriodicTimer t1; // generate a timer from the pool (Pool: 2xGPT, 16xTMR(QUAD), 20xTCK) - -void setup() -{ - pinMode(LED_BUILTIN,OUTPUT); - t1.begin(callback, 250'000); // 250ms -} - -void loop() -{ -} diff --git a/third-party/TeensyTimerTool/examples/01_Basic/MoreTimers/MoreTimers.ino b/third-party/TeensyTimerTool/examples/01_Basic/MoreTimers/MoreTimers.ino deleted file mode 100644 index fba91cb..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/MoreTimers/MoreTimers.ino +++ /dev/null @@ -1,55 +0,0 @@ -//----------------------- -// REQUIRES T4.x -//----------------------- - -#include "TeensyTimerTool.h" - -using namespace TeensyTimerTool; - -PeriodicTimer t1(TCK); // Tick-Timer does not use any hardware timer (20 32bit channels) -PeriodicTimer t2(TMR1); // First channel on TMR1 aka QUAD timer module. (TMR1 - TMR4, four 16bit channels each) -PeriodicTimer t3(GPT1); // GPT1 module (one 32bit channel per module) -OneShotTimer t4(TMR1); // Second channel on TMR1 - -// Callbacks =================================================================================== - -void pulse200ns() -{ - digitalWriteFast(1, HIGH); - delayNanoseconds(200); - digitalWriteFast(1, LOW); -} - -void pulse400ns() -{ - digitalWriteFast(2, HIGH); - delayNanoseconds(400); - digitalWriteFast(2, LOW); -} - -void LED_ON() -{ - digitalWriteFast(LED_BUILTIN, HIGH); // LED On - t4.trigger(10'000); // trigger t4 to switch of after 10ms -} - -void LED_OFF() -{ - digitalWriteFast(LED_BUILTIN, LOW); -} - -//================================================================================================ - -void setup() -{ - for (unsigned pin = 0; pin <= 13; pin++) pinMode(pin, OUTPUT); - - t1.begin(pulse200ns, 50'000); // 200ns pulse every 500 ms - t2.begin(pulse400ns, 100); // 400ns pulse every 100 µs - t3.begin(LED_ON, 1'000'000); // Switch LED on every second - t4.begin(LED_OFF); // One shot timer to switch LED Off -} - -void loop() -{ -} diff --git a/third-party/TeensyTimerTool/examples/01_Basic/RTC_Timer/RTC_Timer.ino b/third-party/TeensyTimerTool/examples/01_Basic/RTC_Timer/RTC_Timer.ino deleted file mode 100644 index b24ca2c..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/RTC_Timer/RTC_Timer.ino +++ /dev/null @@ -1,33 +0,0 @@ -// Uses the built in Real Time Clock (RTC) as timebase. -// The sketch calculates the relative drift of the main 24MHz crystal relative to the 32.768kHz RTC crystal. -// Requires a T4.x board - -#include "Arduino.h" -#include "TeensyTimerTool.h" -using namespace TeensyTimerTool; - -PeriodicTimer t1(TCK_RTC); - -constexpr uint32_t period = 500'000; //µs - -void callback() -{ - static uint32_t start = micros(); - static uint32_t idx = 0; - - uint32_t now = micros() - start; - uint32_t expected = idx++ * period; - int32_t delta = now - expected; - float drift = 1E6 * delta / expected; // ppm - - Serial.printf("t: %d µs, rel. drift: %.2f ppm\n", now, drift); -} - -void setup() -{ - t1.begin(callback, period); -} - -void loop() -{ -} diff --git a/third-party/TeensyTimerTool/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino b/third-party/TeensyTimerTool/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino deleted file mode 100644 index fb33295..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino +++ /dev/null @@ -1,34 +0,0 @@ -#include "TeensyTimerTool.h" -using namespace TeensyTimerTool; - -PeriodicTimer t1(TCK); -PeriodicTimer t2(TCK); - -void isr1() -{ - Serial.printf("called @: %u ms\n", millis()); -} - -void isr2() -{ - digitalToggleFast(LED_BUILTIN); -} - -void isr3() -{ - digitalWriteFast(0,HIGH); - delayMicroseconds(10); - digitalWriteFast(0, LOW); -} - -void setup() -{ - pinMode(LED_BUILTIN, OUTPUT); - - t1.begin(isr1, 5.02s); // instead of 5020000 (µs) - t2.begin(isr2, 25ms); // instead of 25000 (µs) -} - -void loop() -{ -} diff --git a/third-party/TeensyTimerTool/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino b/third-party/TeensyTimerTool/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino deleted file mode 100644 index 401c0da..0000000 --- a/third-party/TeensyTimerTool/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino +++ /dev/null @@ -1,33 +0,0 @@ -#include "TeensyTimerTool.h" -using namespace TeensyTimerTool; - -OneShotTimer timer[]{TCK, TCK, TCK, TCK}; // 4 one-shot-timers -PeriodicTimer pt1; // 1 periodic timer -unsigned t_0; // start time - -void isr() -{ - Serial.printf("called @: %u ms\n", millis() - t_0); -} - -void setup() -{ - while (!Serial) {} // wait for PC to connect the virtual serial port - - for (OneShotTimer& t : timer) // for the sake of simplicity, attach the same isr to all timers in array - { - t.begin(isr); - } - - timer[0].trigger(10ms); // 10 ms - timer[1].trigger(0.5s + 10ms); // 510 ms - timer[2].trigger(2.5 * 0.3s + 20'000us / 2); // 760 ms - timer[3].trigger(milliseconds(50) + microseconds(5000)); // 55ms - t_0 = millis(); - - pt1.begin([] { digitalToggleFast(LED_BUILTIN); }, 0.5s); -} - -void loop() -{ -} diff --git a/third-party/TeensyTimerTool/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino b/third-party/TeensyTimerTool/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino deleted file mode 100644 index c359b35..0000000 --- a/third-party/TeensyTimerTool/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino +++ /dev/null @@ -1,29 +0,0 @@ -#include "TeensyTimerTool.h" - -using namespace TeensyTimerTool; - -void callback(int& someInt, int cnt) // this callback has context, i.e. parameter -{ - for (int i = 0; i < cnt; i++) // when called, print out someInt cnt times - { - Serial.print(someInt); - Serial.print(" | "); - } - Serial.println(); -} - -//============================================================== - -PeriodicTimer t; -int number = 0; - -void setup() -{ - t.begin([] { callback(number, 5); }, 50ms); -} - -void loop() -{ - number++; // change every second - delay(1000); -} \ No newline at end of file diff --git a/third-party/TeensyTimerTool/examples/02_Advanced/UsingLambdas/UsingLambdas.ino b/third-party/TeensyTimerTool/examples/02_Advanced/UsingLambdas/UsingLambdas.ino deleted file mode 100644 index 94becfc..0000000 --- a/third-party/TeensyTimerTool/examples/02_Advanced/UsingLambdas/UsingLambdas.ino +++ /dev/null @@ -1,21 +0,0 @@ - -#include "TeensyTimerTool.h" -#include "pins.h" - -using namespace TeensyTimerTool; -using namespace pins; - -pin<13> LED(OUTPUT); -OneShotTimer timer; - -void setup() -{ - timer.begin([] { LED = LOW; }); -} - -void loop() -{ - LED = HIGH; - timer.trigger(25'000); - delay(1'000); -} diff --git a/third-party/TeensyTimerTool/examples/02_Advanced/UsingLambdas/pins.h b/third-party/TeensyTimerTool/examples/02_Advanced/UsingLambdas/pins.h deleted file mode 100644 index 99dcad7..0000000 --- a/third-party/TeensyTimerTool/examples/02_Advanced/UsingLambdas/pins.h +++ /dev/null @@ -1,253 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace pins -{ - namespace // private - { - enum boards { - notDefined = -1, - T_LC, - T3_0_1_2, - T3_5_6, - }; - -#if defined(__MKL26Z64__) - constexpr boards board = boards::T_LC; -#elif defined(__MK20DX128__) || defined(__MK20DX256__) - constexpr boards board = boards::T3_0_1_2; -#elif defined(__MK64FX512__) || defined(__MK66FX1M0__) - constexpr boards board = boards::T3_5_6; -#else - constexpr boards board = boards::notDefined; -#endif - static_assert(board != boards::notDefined, "Error in Pin.h"); - - // Indices into GPIOx and PORT arrays below - enum portList { - na = -1, Port_A, Port_B, Port_C, Port_D, Port_E - }; - - //Base adresses of the GPIOx register blocks - constexpr uintptr_t GPIOx_PDOR[] = - { - (uintptr_t)&(GPIOA_PDOR), - (uintptr_t)&(GPIOB_PDOR), - (uintptr_t)&(GPIOC_PDOR), - (uintptr_t)&(GPIOD_PDOR), - (uintptr_t)&(GPIOE_PDOR), - }; - - // Base adresses of the Pin Control Registers - constexpr uintptr_t PORTx_PCR0[] = - { - (uintptr_t)&(PORTA_PCR0), - (uintptr_t)&(PORTB_PCR0), - (uintptr_t)&(PORTC_PCR0), - (uintptr_t)&(PORTD_PCR0), - (uintptr_t)&(PORTE_PCR0), - }; - - //---------------------------------------------------------------- - // Translate Teensy pin number to port and bitnr - // The map will be used by the complier only, no code will be generated - - struct pinInfo { - const portList port; - const int pin; - }; - - constexpr pinInfo pinMap[][3] = - { // T-LC T3.0/1/2 T3.5/6 - /* Pin 0 */{ { Port_B, 16 },{ Port_B, 16 },{ Port_B, 16 } }, - /* Pin 1 */{ { Port_B, 17 },{ Port_B, 17 },{ Port_B, 17 } }, - /* Pin 2 */{ { Port_D, 0 },{ Port_D, 0 },{ Port_D, 0 } }, - /* Pin 3 */{ { Port_A, 1 },{ Port_A, 12 },{ Port_A, 12 } }, - /* Pin 4 */{ { Port_A, 2 },{ Port_A, 13 },{ Port_A, 13 } }, - /* Pin 5 */{ { Port_D, 7 },{ Port_D, 7 },{ Port_D, 7 } }, - /* Pin 6 */{ { Port_D, 4 },{ Port_D, 4 },{ Port_D, 4 } }, - /* Pin 7 */{ { Port_D, 2 },{ Port_D, 2 },{ Port_D, 2 } }, - /* Pin 8 */{ { Port_D, 3 },{ Port_D, 3 },{ Port_D, 3 } }, - /* Pin 9 */{ { Port_C, 3 },{ Port_C, 3 },{ Port_C, 3 } }, - /* Pin 10*/{ { Port_C, 4 },{ Port_C, 4 },{ Port_C, 4 } }, - /* Pin 11*/{ { Port_C, 6 },{ Port_C, 6 },{ Port_C, 6 } }, - /* Pin 12*/{ { Port_C, 7 },{ Port_C, 7 },{ Port_C, 7 } }, - /* Pin 13*/{ { Port_C, 5 },{ Port_C, 5 },{ Port_C, 5 } }, - /* Pin 14*/{ { Port_D, 1 },{ Port_D, 1 },{ Port_D, 1 } }, - /* Pin 15*/{ { Port_C, 0 },{ Port_C, 0 },{ Port_C, 0 } }, - /* Pin 16*/{ { Port_B, 0 },{ Port_B, 0 },{ Port_B, 0 } }, - /* Pin 17*/{ { Port_B, 1 },{ Port_B, 1 },{ Port_B, 1 } }, - /* Pin 18*/{ { Port_B, 3 },{ Port_B, 3 },{ Port_B, 3 } }, - /* Pin 19*/{ { Port_B, 2 },{ Port_B, 2 },{ Port_B, 2 } }, - /* Pin 20*/{ { Port_D, 5 },{ Port_D, 5 },{ Port_D, 5 } }, - /* Pin 21*/{ { Port_D, 6 },{ Port_D, 6 },{ Port_D, 6 } }, - /* Pin 22*/{ { Port_C, 1 },{ Port_C, 1 },{ Port_C, 1 } }, - /* Pin 23*/{ { Port_C, 2 },{ Port_C, 2 },{ Port_C, 2 } }, - /* Pin 24*/{ { Port_E, 20 },{ Port_A, 5 },{ Port_E, 26 } }, - /* Pin 25*/{ { Port_E, 21 },{ Port_B, 19 },{ Port_A, 5 } }, - /* Pin 26*/{ { Port_E, 30 },{ Port_E, 1 },{ Port_A, 14 } }, - /* Pin 27*/{ { na, -1 },{ Port_C, 9 },{ Port_A, 15 } }, - /* Pin 28*/{ { na, -1 },{ Port_C, 8 },{ Port_A, 16 } }, - /* Pin 29*/{ { na, -1 },{ Port_C, 10 },{ Port_B, 18 } }, - /* Pin 30*/{ { na, -1 },{ Port_C, 5 },{ Port_B, 19 } }, - /* Pin 31*/{ { na, -1 },{ Port_E, 6 },{ Port_B, 10 } }, - /* Pin 32*/{ { na, -1 },{ Port_B, 1 },{ Port_B, 11 } }, - /* Pin 33*/{ { na, -1 },{ Port_A, 2 },{ Port_E, 24 } }, - /* Pin 34*/{ { na, -1 },{ na, -1 },{ Port_E, 25 } }, - /* Pin 35*/{ { na, -1 },{ na, -1 },{ Port_C, 8 } }, - /* Pin 36*/{ { na, -1 },{ na, -1 },{ Port_C, 9 } }, - /* Pin 37*/{ { na, -1 },{ na, -1 },{ Port_C, 10 } }, - /* Pin 38*/{ { na, -1 },{ na, -1 },{ Port_C, 11 } }, - /* Pin 39*/{ { na, -1 },{ na, -1 },{ Port_A, 17 } }, - /* Pin 40*/{ { na, -1 },{ na, -1 },{ Port_A, 28 } }, - /* Pin 41*/{ { na, -1 },{ na, -1 },{ Port_A, 29 } }, - /* Pin 42*/{ { na, -1 },{ na, -1 },{ Port_A, 26 } }, - /* Pin 43*/{ { na, -1 },{ na, -1 },{ Port_B, 20 } }, - /* Pin 44*/{ { na, -1 },{ na, -1 },{ Port_B, 22 } }, - /* Pin 45*/{ { na, -1 },{ na, -1 },{ Port_B, 23 } }, - /* Pin 46*/{ { na, -1 },{ na, -1 },{ Port_B, 21 } }, - /* Pin 47*/{ { na, -1 },{ na, -1 },{ Port_D, 8 } }, - /* Pin 48*/{ { na, -1 },{ na, -1 },{ Port_D, 9 } }, - /* Pin 49*/{ { na, -1 },{ na, -1 },{ Port_B, 4 } }, - /* Pin 50*/{ { na, -1 },{ na, -1 },{ Port_B, 5 } }, - /* Pin 51*/{ { na, -1 },{ na, -1 },{ Port_D, 14 } }, - /* Pin 52*/{ { na, -1 },{ na, -1 },{ Port_D, 13 } }, - /* Pin 53*/{ { na, -1 },{ na, -1 },{ Port_D, 12 } }, - /* Pin 54*/{ { na, -1 },{ na, -1 },{ Port_D, 15 } }, - /* Pin 55*/{ { na, -1 },{ na, -1 },{ Port_D, 11 } }, - /* Pin 56*/{ { na, -1 },{ na, -1 },{ Port_E, 10 } }, - /* Pin 57*/{ { na, -1 },{ na, -1 },{ Port_E, 11 } }, - /* Pin 58*/{ { na, -1 },{ na, -1 },{ Port_E, 0 } }, - /* Pin 59*/{ { na, -1 },{ na, -1 },{ Port_E, 1 } }, - /* Pin 60*/{ { na, -1 },{ na, -1 },{ Port_E, 2 } }, - /* Pin 61*/{ { na, -1 },{ na, -1 },{ Port_E, 3 } }, - /* Pin 62*/{ { na, -1 },{ na, -1 },{ Port_E, 4 } }, - /* Pin 63*/{ { na, -1 },{ na, -1 },{ Port_E, 5 } }, - }; - } - - // Pin Mux constants - enum pinMux - { - ALT0 = 0, - ALT1, ALT2, ALT3, ALT4, ALT5, ALT6, ALT7 - }; - - //----------------------------------------------------------------------------------------------------- - // Pin class - // all methods static, no instances will be generated in code - - template - class pin - { - private: - // Calculate the adress of the pin control register - static constexpr uintptr_t get_PORTx_PCRn_addr() - { - static_assert(pinMap[pinNr][board].port != na && pinMap[pinNr][board].pin != -1, "Pin not supported by board"); - return PORTx_PCR0[(pinMap[pinNr][board]).port] + 4 * pinMap[pinNr][board].pin; - } - - // Calculate the adress of the bit banded GPIO registers of the pin - static constexpr uintptr_t getPDORAdr() - { - return 0x42000000 + 32 * (GPIOx_PDOR[pinMap[pinNr][board].port] - 0x40000000) + 4 * pinMap[pinNr][board].pin; - } - - static constexpr uintptr_t pcr = get_PORTx_PCRn_addr(); // Pin Control Register - static constexpr uintptr_t pdorBB = getPDORAdr(); // Bitband adress of GPIOx_PDOR - static constexpr uintptr_t psorBB = pdorBB + 4 * 32; // GPIOx_PSOR = GPIOx_PDOR + 4 - static constexpr uintptr_t pcorBB = psorBB + 4 * 32; // GPIOx_PCOR = GPIOx_PDOR + 8 - static constexpr uintptr_t ptorBB = pcorBB + 4 * 32; // GPIOx_PTOR = GPIOx_PDOR + 12 - static constexpr uintptr_t pdirBB = ptorBB + 4 * 32; // GPIOx_PDIR = GPIOx_PDOR + 16 - static constexpr uintptr_t pddrBB = pdirBB + 4 * 32; // GPIOx_PDDR = GPIOx_PDOR + 20 - - public: - // Construction (class contains only static members) - pin() {} - pin(int i) { pinMode(i); } - - pin(const pin&) = delete; // disable copy constructor - - // Setting and getting the pin value - template::value>::type> - operator T() const { return *reinterpret_cast(pdirBB); } - operator bool() const { return *reinterpret_cast(pdirBB) & 1; } - inline void operator = (const bool v) const { *reinterpret_cast(pdorBB) = v; } // assignment --> somePin = HIGH - inline void operator = (const pin& v) const = delete; // disable copying - - // Pin operations - static inline void toggle() { *reinterpret_cast(ptorBB) = 1; } // toggles pin - //static inline int getValue() { return *reinterpret_cast(pdirBB); } // returns pin value (usefull for static calls) - //static inline void setValue(const int v) { *reinterpret_cast(pdorBB) = v; } // sets value (usefull for static calls) - //static inline void setHIGH() { *reinterpret_cast(psorBB) = 1; } // sets pin to HIGH (usefull for static calls) - //static inline void setLOW() { *reinterpret_cast(pcorBB) = 1; } // sets pin to LOW (usefull for static calls) - - // Pin configuration - static inline void pinMode(int mode) - { - // replace by a call to pinMode(pinNr,mode) ??? TBD - switch (mode) - { - case OUTPUT: - *reinterpret_cast(pddrBB) = 1; //Pin direction register - *reinterpret_cast(pcr) = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); //Pin control register - break; - case OUTPUT_OPENDRAIN: - *reinterpret_cast(pddrBB) = 1; - *reinterpret_cast(pcr) = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1) | PORT_PCR_ODE; - break; - case INPUT: - *reinterpret_cast(pddrBB) = 0; - *reinterpret_cast(pcr) = PORT_PCR_MUX(1); - break; - case INPUT_PULLUP: - *reinterpret_cast(pddrBB) = 0; - *reinterpret_cast(pcr) = PORT_PCR_MUX(1) | PORT_PCR_PE | PORT_PCR_PS; - break; - case INPUT_PULLDOWN: - *reinterpret_cast(pddrBB) = 0; - *reinterpret_cast(pcr) = PORT_PCR_MUX(1) | PORT_PCR_PE; - break; - case INPUT_DISABLE: - *reinterpret_cast(pcr) = 0; - break; - } - } - - static inline void driveStrengthEnable(bool enable) - { - //TBD static_assert: pin has DSE capability - if (enable) { - *reinterpret_cast(pcr) |= PORT_PCR_DSE; - } - else { - *reinterpret_cast(pcr) &= ~PORT_PCR_DSE; - } - } - - static inline void slowSlewRateEnable(bool enable) - { - //TBD static_assert: pin has SRE capability - if (enable) { - *reinterpret_cast(pcr) |= PORT_PCR_SRE; - } - else { - *reinterpret_cast(pcr) &= ~PORT_PCR_SRE; - } - } - - static inline void setMUX(pinMux altFunc) - { - *reinterpret_cast(pcr) = (*reinterpret_cast(pcr) & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(altFunc); - } - - static inline void attachInterrupt(void(*function)(void), int mode) - { - ::attachInterrupt(pinNr, function, mode); - } - }; -} \ No newline at end of file diff --git a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/DoubleExposure.ino b/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/DoubleExposure.ino deleted file mode 100644 index d3e3a48..0000000 --- a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/DoubleExposure.ino +++ /dev/null @@ -1,38 +0,0 @@ -#include "SystemController.h" - -// --> Uncomment if you have a control voltage on the pot pin <-- -// #include "ResponsiveAnalogRead.h" -// constexpr unsigned potPin = A0; -// ResponsiveAnalogRead pot(potPin, false); - -SystemController sysControl; - -void setup() -{ - sysControl.begin(); - - sysControl.setExposureDelay(250); // set exposure delay (time between two exposures) to 250 µs - sysControl.shoot(); // do a manual exposure - delay(10); - sysControl.setExposureDelay(500); // same with 500µs delay between exposures - sysControl.shoot(); - - sysControl.continuosMode(true); // start continuously shooting - delay(1000); - sysControl.continuosMode(false); // stop after one second - - delay(500); - sysControl.continuosMode(true); // start again -} - -void loop() -{ - // --> Uncomment if you have a control voltage on the pot pin <-- - // pot.update(); - // if (pot.hasChanged()) - // { - // unsigned expDelay = map(pot.getValue(), 0, 1023, 100, 500); // 0-3.3V analog value, maps to 100-500 - // controller.setExposureDelay(expDelay); - // Serial.printf("Exposure Delay: %u µs\n", expDelay); - // } -} diff --git a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/LaserController.h b/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/LaserController.h deleted file mode 100644 index fcdb72a..0000000 --- a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/LaserController.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -#include "PulseGenerator.h" -#include "TeensyTimerTool.h" - -class LaserController -{ - public: - void begin(unsigned preTriggerPin, unsigned triggerPin, unsigned camPin); - void shoot(); - - protected: - PulseGenerator preTrigger, trigger, camera; -}; - -void LaserController::begin(unsigned preTriggerPin, unsigned triggerPin, unsigned camPin) -{ - preTrigger.begin(preTriggerPin); - trigger.begin(triggerPin); - camera.begin(camPin); -} - -void LaserController::shoot() -{ - constexpr float t_warmup = 140 - 5.5; - constexpr float t_p = 10 - 3; - constexpr float t_camDelay = 130 - 7.5; - constexpr float t_int = 30 - 3; - - preTrigger.schedulePulse(0, t_p); // immediately generate the pretrigger pulse - trigger.schedulePulse(t_warmup, t_p); // schedule the trigger pulse to start after the warmup time - camera.schedulePulse(t_camDelay, t_int); // schedule the cam pulse after the camDelay time -} diff --git a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/PulseGenerator.h b/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/PulseGenerator.h deleted file mode 100644 index 9a1ff34..0000000 --- a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/PulseGenerator.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "TeensyTimerTool.h" - -class PulseGenerator -{ - public: - PulseGenerator(); // constructor, initializes non hardware related stuff - void begin(unsigned pin); // initializes hardware related stuff - void schedulePulse(float delay, float width); // schedules a 'width µs' wide pulse after a waiting time of 'delay µs'. Non blocking. - - protected: - TeensyTimerTool::OneShotTimer pulseTimer; // used for generating the pulses - void callback(); - - uint32_t pin; - float width; -}; - - - -void PulseGenerator::begin(unsigned pin) -{ - this->pin = pin; - pinMode(pin, OUTPUT); - digitalWriteFast(pin, LOW); - - pulseTimer.begin([this] { this->callback(); }); -} - -void PulseGenerator::schedulePulse(float delay, float _width) -{ - width = _width; // the timer callback needs to know the pulse width to generate the pulse - - if (delay != 0) - { - pulseTimer.trigger(delay); // this triggers the oneShot timer to fire after 'delay µs' - } - else //delay == 0, directly generate the pulse - { - digitalWriteFast(pin, HIGH); - pulseTimer.trigger(width); // this triggers the oneShotTimer to fire after 'width µs' - } -} - -void PulseGenerator::callback() -{ - if (digitalReadFast(pin) == LOW) - { - digitalWriteFast(pin, HIGH); - pulseTimer.trigger(width); // re-trigger - } else - { - digitalWriteFast(pin, LOW); - } -} - -PulseGenerator::PulseGenerator() - : pulseTimer(TeensyTimerTool::FTM0) // use one of the 8 FTM0 channels -{} \ No newline at end of file diff --git a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/README.md b/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/README.md deleted file mode 100644 index bec8308..0000000 --- a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/README.md +++ /dev/null @@ -1 +0,0 @@ -### See https://github.com/luni64/TeensyTimerTool/wiki/Double-Exposure-Laser-Illuminator for a description of this example. diff --git a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/SystemController.h b/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/SystemController.h deleted file mode 100644 index c9091b2..0000000 --- a/third-party/TeensyTimerTool/examples/03_Applications/DoubleExposure/SystemController.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -#include "LaserController.h" -#include "TeensyTimerTool.h" - -class SystemController -{ - public: - SystemController(); - inline void begin(); - inline void shoot(); - - inline void continuosMode(bool on); - inline void setExposureDelay(unsigned delay); - - protected: - TeensyTimerTool::PeriodicTimer mainTimer; - LaserController lCtrl1, lCtrl2; - unsigned exposureDelay = 300; -}; - -SystemController::SystemController() - : mainTimer(TeensyTimerTool::TCK) {} // construct the main 15Hz timer, we use a TCK here - -void SystemController::begin() -{ - constexpr unsigned repetitionRate = 15; // Hz - - constexpr unsigned preTrig1_pin = 1; - constexpr unsigned trig1_pin = 2; - constexpr unsigned preTrig2_pin = 3; - constexpr unsigned trig2_pin = 4; - constexpr unsigned cam_pin = 5; - - lCtrl1.begin(preTrig1_pin, trig1_pin, cam_pin); - lCtrl2.begin(preTrig2_pin, trig2_pin, cam_pin); - - mainTimer.begin([this] { this->shoot(); }, 1E6 / repetitionRate, false); // attach callback but don't start yet -} - -void SystemController::shoot() -{ - elapsedMicros stopwatch = 0; - lCtrl1.shoot(); - while (stopwatch < exposureDelay) { yield(); } - lCtrl2.shoot(); -} - -void SystemController::continuosMode(bool on) -{ - if (on) - { - mainTimer.start(); - } else - { - mainTimer.stop(); - } -} - -void SystemController::setExposureDelay(unsigned delay) -{ - exposureDelay = max(100u, min(500u, delay)); // limit to 100-500 µs -} diff --git a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/GPIO_Info.h b/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/GPIO_Info.h deleted file mode 100644 index 819930d..0000000 --- a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/GPIO_Info.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include "core_pins.h" -#include - -struct GPIO_Info_t -{ - inline GPIO_Info_t(unsigned pin); - const uintptr_t pinCfg; - const unsigned gpioPortNr; - const unsigned gpioBitNr; - - char name[20]; -}; - -//====================================================================================== -#if defined(KINETISK) || defined(KINETISL) - -GPIO_Info_t::GPIO_Info_t(unsigned pin) - : pinCfg((uintptr_t)digital_pin_to_info_PGM[pin].config), // address of pin config register - gpioPortNr((pinCfg - (uintptr_t)&PORTA_PCR0) / 0x1000), // cfg base addresses are 4kB aligned staring with PORTA_PCR0 - gpioBitNr((pinCfg & 0xFFF) / 4) // each bit has to 4 consecutive 32bit cfg registers -{ - snprintf(name, 20, "GPIO%d_%02d", gpioPortNr, gpioBitNr); -} - -//====================================================================================== -#elif defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) || defined(ARDUINO_TEENSY_MICROMOD) - - -GPIO_Info_t::GPIO_Info_t(unsigned pin) - : pinCfg((uintptr_t)digital_pin_to_info_PGM[pin].reg), // address of pin config register - gpioPortNr((pinCfg - (uintptr_t)&IMXRT_GPIO6) / 0x4000 + 6), // cfg base addresses are 4kB aligned staring with PORTA_PCR0 - gpioBitNr(__builtin_ffs(digital_pin_to_info_PGM[pin].mask) - 1) // each bit has to 4 consecutive 32bit cfg registers -{ - snprintf(name, 20, "GPIO%d_%02d", gpioPortNr, gpioBitNr); -} - -#endif \ No newline at end of file diff --git a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PWM_TimerInfo.c b/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PWM_TimerInfo.c deleted file mode 100644 index 9a01feb..0000000 --- a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PWM_TimerInfo.c +++ /dev/null @@ -1,213 +0,0 @@ -#include "core_pins.h" - -/***** - * Unlike Teensy 4.x there is no information array in the core for the T3.x series - * We thus build the corresponding array from copies of the pin definitions in core_pins.h - *****/ - - -#if defined(ARDUINO_TEENSYLC) - -const int PwmTimerModule[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = -1, - [CORE_TPM0_CH0_PIN] = 0, - [CORE_TPM0_CH1_PIN] = 0, - [CORE_TPM0_CH2_PIN] = 0, - [CORE_TPM0_CH3_PIN] = 0, - [CORE_TPM0_CH4_PIN] = 0, - [CORE_TPM0_CH5_PIN] = 0, - [CORE_TPM1_CH0_PIN] = 1, - [CORE_TPM1_CH1_PIN] = 1, - [CORE_TPM2_CH0_PIN] = 2, - [CORE_TPM2_CH1_PIN] = 2, -}; - -const int PwmTimerType[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = 0, - [CORE_TPM0_CH0_PIN] = 2, - [CORE_TPM0_CH1_PIN] = 2, - [CORE_TPM0_CH2_PIN] = 2, - [CORE_TPM0_CH3_PIN] = 2, - [CORE_TPM0_CH4_PIN] = 2, - [CORE_TPM0_CH5_PIN] = 2, - [CORE_TPM1_CH0_PIN] = 2, - [CORE_TPM1_CH1_PIN] = 2, - [CORE_TPM2_CH0_PIN] = 2, - [CORE_TPM2_CH1_PIN] = 2, -}; - -//=========================================================================================== -#elif defined(ARDUINO_TEENSY30) - -const int PwmTimerModule[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = -1, - [CORE_FTM0_CH0_PIN] = 0, - [CORE_FTM0_CH1_PIN] = 0, - [CORE_FTM0_CH2_PIN] = 0, - [CORE_FTM0_CH3_PIN] = 0, - [CORE_FTM0_CH4_PIN] = 0, - [CORE_FTM0_CH5_PIN] = 0, - [CORE_FTM0_CH6_PIN] = 0, - [CORE_FTM0_CH7_PIN] = 0, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, -}; - -const int PwmTimerType[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = 0, - [CORE_FTM0_CH0_PIN] = 1, - [CORE_FTM0_CH1_PIN] = 1, - [CORE_FTM0_CH2_PIN] = 1, - [CORE_FTM0_CH3_PIN] = 1, - [CORE_FTM0_CH4_PIN] = 1, - [CORE_FTM0_CH5_PIN] = 1, - [CORE_FTM0_CH6_PIN] = 1, - [CORE_FTM0_CH7_PIN] = 1, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, -}; - -//=========================================================================================== -#elif defined(__MK20DX256__) -const int PwmTimerModule[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = -1, - [CORE_FTM0_CH0_PIN] = 0, - [CORE_FTM0_CH1_PIN] = 0, - [CORE_FTM0_CH0_PIN] = 0, - [CORE_FTM0_CH1_PIN] = 0, - [CORE_FTM0_CH2_PIN] = 0, - [CORE_FTM0_CH3_PIN] = 0, - [CORE_FTM0_CH4_PIN] = 0, - [CORE_FTM0_CH5_PIN] = 0, - [CORE_FTM0_CH6_PIN] = 0, - [CORE_FTM0_CH7_PIN] = 0, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, - [CORE_FTM2_CH0_PIN] = 2, - [CORE_FTM2_CH1_PIN] = 2, -}; - -//=========================================================================================== -const int PwmTimerType[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = 0, - [CORE_FTM0_CH0_PIN] = 1, - [CORE_FTM0_CH1_PIN] = 1, - [CORE_FTM0_CH0_PIN] = 1, - [CORE_FTM0_CH1_PIN] = 1, - [CORE_FTM0_CH2_PIN] = 1, - [CORE_FTM0_CH3_PIN] = 1, - [CORE_FTM0_CH4_PIN] = 1, - [CORE_FTM0_CH5_PIN] = 1, - [CORE_FTM0_CH6_PIN] = 1, - [CORE_FTM0_CH7_PIN] = 1, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, - [CORE_FTM2_CH0_PIN] = 1, - [CORE_FTM2_CH1_PIN] = 1, -}; - -//=========================================================================================== -#elif defined(ARDUINO_TEENSY35) -const int PwmTimerModule[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = -1, - [CORE_FTM0_CH0_PIN] = 0, - [CORE_FTM0_CH1_PIN] = 0, - [CORE_FTM0_CH2_PIN] = 0, - [CORE_FTM0_CH3_PIN] = 0, - [CORE_FTM0_CH4_PIN] = 0, - [CORE_FTM0_CH5_PIN] = 0, - [CORE_FTM0_CH6_PIN] = 0, - [CORE_FTM0_CH7_PIN] = 0, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, - [CORE_FTM2_CH0_PIN] = 2, - [CORE_FTM2_CH1_PIN] = 2, - [CORE_FTM3_CH0_PIN] = 3, - [CORE_FTM3_CH1_PIN] = 3, - [CORE_FTM3_CH2_PIN] = 3, - [CORE_FTM3_CH3_PIN] = 3, - [CORE_FTM3_CH4_PIN] = 3, - [CORE_FTM3_CH5_PIN] = 3, - [CORE_FTM3_CH6_PIN] = 3, - [CORE_FTM3_CH7_PIN] = 3, -}; - -const int PwmTimerType[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = 0, - [CORE_FTM0_CH0_PIN] = 1, - [CORE_FTM0_CH1_PIN] = 1, - [CORE_FTM0_CH2_PIN] = 1, - [CORE_FTM0_CH3_PIN] = 1, - [CORE_FTM0_CH4_PIN] = 1, - [CORE_FTM0_CH5_PIN] = 1, - [CORE_FTM0_CH6_PIN] = 1, - [CORE_FTM0_CH7_PIN] = 1, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, - [CORE_FTM2_CH0_PIN] = 1, - [CORE_FTM2_CH1_PIN] = 1, - [CORE_FTM3_CH0_PIN] = 1, - [CORE_FTM3_CH1_PIN] = 1, - [CORE_FTM3_CH2_PIN] = 1, - [CORE_FTM3_CH3_PIN] = 1, - [CORE_FTM3_CH4_PIN] = 1, - [CORE_FTM3_CH5_PIN] = 1, - [CORE_FTM3_CH6_PIN] = 1, - [CORE_FTM3_CH7_PIN] = 1, -}; - -//=========================================================================================== -#elif defined(ARDUINO_TEENSY36) -const int PwmTimerModule[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = -1, - [CORE_FTM0_CH0_PIN] = 0, - [CORE_FTM0_CH1_PIN] = 0, - [CORE_FTM0_CH2_PIN] = 0, - [CORE_FTM0_CH3_PIN] = 0, - [CORE_FTM0_CH4_PIN] = 0, - [CORE_FTM0_CH5_PIN] = 0, - [CORE_FTM0_CH6_PIN] = 0, - [CORE_FTM0_CH7_PIN] = 0, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, - [CORE_FTM2_CH0_PIN] = 2, - [CORE_FTM2_CH1_PIN] = 2, - [CORE_FTM3_CH0_PIN] = 3, - [CORE_FTM3_CH1_PIN] = 3, - [CORE_FTM3_CH2_PIN] = 3, - [CORE_FTM3_CH3_PIN] = 3, - [CORE_FTM3_CH4_PIN] = 3, - [CORE_FTM3_CH5_PIN] = 3, - [CORE_FTM3_CH6_PIN] = 3, - [CORE_FTM3_CH7_PIN] = 3, - [CORE_TPM1_CH0_PIN] = 1, - [CORE_TPM1_CH1_PIN] = 1, -}; - -const int PwmTimerType[CORE_NUM_DIGITAL] = { - [0 ... CORE_NUM_DIGITAL - 1] = 0, - [CORE_FTM0_CH0_PIN] = 1, - [CORE_FTM0_CH1_PIN] = 1, - [CORE_FTM0_CH2_PIN] = 1, - [CORE_FTM0_CH3_PIN] = 1, - [CORE_FTM0_CH4_PIN] = 1, - [CORE_FTM0_CH5_PIN] = 1, - [CORE_FTM0_CH6_PIN] = 1, - [CORE_FTM0_CH7_PIN] = 1, - [CORE_FTM1_CH0_PIN] = 1, - [CORE_FTM1_CH1_PIN] = 1, - [CORE_FTM2_CH0_PIN] = 1, - [CORE_FTM2_CH1_PIN] = 1, - [CORE_FTM3_CH0_PIN] = 1, - [CORE_FTM3_CH1_PIN] = 1, - [CORE_FTM3_CH2_PIN] = 1, - [CORE_FTM3_CH3_PIN] = 1, - [CORE_FTM3_CH4_PIN] = 1, - [CORE_FTM3_CH5_PIN] = 1, - [CORE_FTM3_CH6_PIN] = 1, - [CORE_FTM3_CH7_PIN] = 1, - [CORE_TPM1_CH0_PIN] = 2, - [CORE_TPM1_CH1_PIN] = 2, -}; - -#endif diff --git a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PWM_TimerInfo.h b/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PWM_TimerInfo.h deleted file mode 100644 index 148d17e..0000000 --- a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PWM_TimerInfo.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once - -#include "core_pins.h" -#include - -struct PWM_TimerInfo_t -{ - inline PWM_TimerInfo_t(unsigned _pin = 0); - unsigned type; - unsigned module; - char name[20]; -}; - -//=========================================================================================================== -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) || defined(ARDUINO_TEENSY_MICROMOD) - -// holds core info about used pwm timers. Struct is defined in pwm.c. -// There is no header declaring it. So, we need to do this here: -struct pwm_pin_info_struct -{ - uint8_t type; // 0=no pwm, 1=flexpwm, 2=quad - uint8_t module; // 0-3, 0-3 - uint8_t channel; // 0=X, 1=A, 2=B - uint8_t muxval; // -}; -extern pwm_pin_info_struct pwm_pin_info[]; // This array holds the pwm timer info - -PWM_TimerInfo_t::PWM_TimerInfo_t(unsigned pin) -{ - constexpr char timerNames[][9] = {"FLEX_PWM", "QUAD"}; - - type = pwm_pin_info[pin].type; - module = (pwm_pin_info[pin].module >> 4) + 1; - - if (type != 0) - snprintf(name, 20, "%s%d", timerNames[type - 1], module); - else - snprintf(name, 20, "no pwm"); -} - -//=========================================================================================================== -#elif defined(ARDUINO_TEENSYLC) || \ - defined(ARDUINO_TEENSY30) || defined(ARDUINO_TEENSY32) || \ - defined(ARDUINO_TEENSY35) || defined(ARDUINO_TEENSY36) - -extern "C" const int PwmTimerModule[CORE_NUM_DIGITAL]; -extern "C" const int PwmTimerType[CORE_NUM_DIGITAL]; - -PWM_TimerInfo_t::PWM_TimerInfo_t(unsigned pin) -{ - constexpr char timerNames[][9] = {"FTM", "TPM"}; - - type = PwmTimerType[pin]; - module = PwmTimerModule[pin]; - - if (type != 0) - snprintf(name, 20, "%s%d", timerNames[type - 1], module); - else - snprintf(name, 20, "none"); -} - -#endif \ No newline at end of file diff --git a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PinInfo.h b/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PinInfo.h deleted file mode 100644 index 0821167..0000000 --- a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PinInfo.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "GPIO_Info.h" -#include "PWM_TimerInfo.h" - -struct PinInfo -{ - inline PinInfo(unsigned _pin) - : pin(_pin), - gpioInfo(pin), - pwmTimerInfo(pin) - {} - - const unsigned pin; - const GPIO_Info_t gpioInfo; - const PWM_TimerInfo_t pwmTimerInfo; -}; diff --git a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PinInformation.ino b/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PinInformation.ino deleted file mode 100644 index 3e2eb76..0000000 --- a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/PinInformation.ino +++ /dev/null @@ -1,57 +0,0 @@ -#include "Arduino.h" - -#include "PinInfo.h" -#include - -void printPins(PinInfo* pins[], unsigned nrOfPins); - -void setup() -{ - while (!Serial) {} - - // setup an array containing info for all digital pins - PinInfo* pins[CORE_NUM_DIGITAL]; - for (unsigned i = 0; i < CORE_NUM_DIGITAL; i++) - { - pins[i] = new PinInfo(i); - } - - // Print out info sorted by pin numbers - Serial.println("-------------------------------"); - Serial.println(" Sorted by pin number"); - printPins(pins, CORE_NUM_DIGITAL); - - Serial.println("\n-------------------------------"); - Serial.println(" Sorted by PWM timer"); - std::sort(pins, pins + CORE_NUM_DIGITAL, [](PinInfo* a, PinInfo* b) { - if (a->pwmTimerInfo.type < b->pwmTimerInfo.type) return false; - if (a->pwmTimerInfo.type > b->pwmTimerInfo.type) return true; - if (a->pwmTimerInfo.module < b->pwmTimerInfo.module) return true; - return false; - }); - printPins(pins, CORE_NUM_DIGITAL); - - Serial.println("\n-------------------------------"); - Serial.println(" Sorted by GPIO register: "); - std::sort(pins, pins + CORE_NUM_DIGITAL, [](PinInfo* a, PinInfo* b) { - if (a->gpioInfo.gpioPortNr < b->gpioInfo.gpioPortNr) return true; - if (a->gpioInfo.gpioPortNr > b->gpioInfo.gpioPortNr) return false; - if (a->gpioInfo.gpioBitNr < b->gpioInfo.gpioBitNr) return true; - return false; - }); - printPins(pins, CORE_NUM_DIGITAL); -} - -void loop() {} - -// Helpers ------------------------------------------------------- - -void printPins(PinInfo* pins[], unsigned nrOfPins) -{ - Serial.println("Pin | GPIO Reg | PWM timer"); - Serial.println("----|------------|-------------"); - for (unsigned i = 0; i < nrOfPins; i++) - { - Serial.printf("%02d | %-9s | %-10s\n", pins[i]->pin, pins[i]->gpioInfo.name, pins[i]->pwmTimerInfo.name); - } -} diff --git a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/boards.txt b/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/boards.txt deleted file mode 100644 index 17b59a7..0000000 --- a/third-party/TeensyTimerTool/examples/99_Misc/PinInformation/boards.txt +++ /dev/null @@ -1,1569 +0,0 @@ -menu.usb=USB Type -menu.speed=CPU Speed -menu.opt=Optimize -menu.keys=Keyboard Layout - - -teensy41.name=Teensy 4.1 -teensy41.upload.maximum_size=8126464 -teensy41.build.board=TEENSY41 -teensy41.build.flags.ld=-Wl,--gc-sections,--relax "-T{build.core.path}/imxrt1062_t41.ld" -teensy41.upload.maximum_data_size=524288 -#teensy41.upload.maximum_data_size=1048576 -teensy41.upload.tool=teensyloader -teensy41.upload.protocol=halfkay -teensy41.build.core=teensy4 -teensy41.build.mcu=imxrt1062 -teensy41.build.warn_data_percentage=99 -teensy41.build.toolchain=arm/bin/ -teensy41.build.command.gcc=arm-none-eabi-gcc -teensy41.build.command.g++=arm-none-eabi-g++ -teensy41.build.command.ar=arm-none-eabi-gcc-ar -teensy41.build.command.objcopy=arm-none-eabi-objcopy -teensy41.build.command.objdump=arm-none-eabi-objdump -teensy41.build.command.linker=arm-none-eabi-gcc -teensy41.build.command.size=arm-none-eabi-size -teensy41.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -teensy41.build.flags.dep=-MMD -teensy41.build.flags.optimize=-Os -teensy41.build.flags.cpu=-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -teensy41.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=153 -teensy41.build.flags.cpp=-std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -teensy41.build.flags.c= -teensy41.build.flags.S=-x assembler-with-cpp -teensy41.build.flags.libs=-larm_cortexM7lfsp_math -lm -lstdc++ -teensy41.serial.restart_cmd=false -teensy41.menu.usb.serial=Serial -teensy41.menu.usb.serial.build.usbtype=USB_SERIAL -teensy41.menu.usb.serial2=Dual Serial -teensy41.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL -teensy41.menu.usb.serial3=Triple Serial -teensy41.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL -teensy41.menu.usb.keyboard=Keyboard -teensy41.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY -teensy41.menu.usb.keyboard.fake_serial=teensy_gateway -teensy41.menu.usb.touch=Keyboard + Touch Screen -teensy41.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN -teensy41.menu.usb.touch.fake_serial=teensy_gateway -teensy41.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen -teensy41.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN -teensy41.menu.usb.hidtouch.fake_serial=teensy_gateway -teensy41.menu.usb.hid=Keyboard + Mouse + Joystick -teensy41.menu.usb.hid.build.usbtype=USB_HID -teensy41.menu.usb.hid.fake_serial=teensy_gateway -teensy41.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensy41.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensy41.menu.usb.midi=MIDI -teensy41.menu.usb.midi.build.usbtype=USB_MIDI -teensy41.menu.usb.midi.fake_serial=teensy_gateway -teensy41.menu.usb.midi4=MIDIx4 -teensy41.menu.usb.midi4.build.usbtype=USB_MIDI4 -teensy41.menu.usb.midi4.fake_serial=teensy_gateway -teensy41.menu.usb.midi16=MIDIx16 -teensy41.menu.usb.midi16.build.usbtype=USB_MIDI16 -teensy41.menu.usb.midi16.fake_serial=teensy_gateway -teensy41.menu.usb.serialmidi=Serial + MIDI -teensy41.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL -teensy41.menu.usb.serialmidi4=Serial + MIDIx4 -teensy41.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL -teensy41.menu.usb.serialmidi16=Serial + MIDIx16 -teensy41.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL -teensy41.menu.usb.audio=Audio -teensy41.menu.usb.audio.build.usbtype=USB_AUDIO -teensy41.menu.usb.audio.fake_serial=teensy_gateway -teensy41.menu.usb.serialmidiaudio=Serial + MIDI + Audio -teensy41.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL -teensy41.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio -teensy41.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL -teensy41.menu.usb.mtp=MTP Disk (Experimental) -teensy41.menu.usb.mtp.build.usbtype=USB_MTPDISK -teensy41.menu.usb.mtp.fake_serial=teensy_gateway -teensy41.menu.usb.rawhid=Raw HID -teensy41.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensy41.menu.usb.rawhid.fake_serial=teensy_gateway -teensy41.menu.usb.flightsim=Flight Sim Controls -teensy41.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensy41.menu.usb.flightsim.fake_serial=teensy_gateway -teensy41.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick -teensy41.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK -teensy41.menu.usb.flightsimjoystick.fake_serial=teensy_gateway -#teensy41.menu.usb.disable=No USB -#teensy41.menu.usb.disable.build.usbtype=USB_DISABLED - -teensy41.menu.speed.600=600 MHz -teensy41.menu.speed.528=528 MHz -teensy41.menu.speed.450=450 MHz -teensy41.menu.speed.396=396 MHz -teensy41.menu.speed.150=150 MHz -teensy41.menu.speed.24=24 MHz -teensy41.menu.speed.720=720 MHz (overclock) -teensy41.menu.speed.816=816 MHz (overclock) -teensy41.menu.speed.912=912 MHz (overclock, cooling req'd) -teensy41.menu.speed.960=960 MHz (overclock, cooling req'd) -teensy41.menu.speed.1008=1.008 GHz (overclock, cooling req'd) -teensy41.menu.speed.1008.build.fcpu=1008000000 -teensy41.menu.speed.960.build.fcpu=960000000 -teensy41.menu.speed.912.build.fcpu=912000000 -teensy41.menu.speed.816.build.fcpu=816000000 -teensy41.menu.speed.720.build.fcpu=720000000 -teensy41.menu.speed.600.build.fcpu=600000000 -teensy41.menu.speed.528.build.fcpu=528000000 -teensy41.menu.speed.450.build.fcpu=450000000 -teensy41.menu.speed.396.build.fcpu=396000000 -teensy41.menu.speed.150.build.fcpu=150000000 -teensy41.menu.speed.24.build.fcpu=24000000 - -teensy41.menu.opt.o2std=Faster -teensy41.menu.opt.o2std.build.flags.optimize=-O2 -teensy41.menu.opt.o2std.build.flags.ldspecs= -#teensy41.menu.opt.o2lto=Faster with LTO -#teensy41.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects -#teensy41.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin -teensy41.menu.opt.o1std=Fast -teensy41.menu.opt.o1std.build.flags.optimize=-O1 -teensy41.menu.opt.o1std.build.flags.ldspecs= -#teensy41.menu.opt.o1lto=Fast with LTO -#teensy41.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects -#teensy41.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin -teensy41.menu.opt.o3std=Fastest -teensy41.menu.opt.o3std.build.flags.optimize=-O3 -teensy41.menu.opt.o3std.build.flags.ldspecs= -#teensy41.menu.opt.o3purestd=Fastest + pure-code -#teensy41.menu.opt.o3purestd.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -#teensy41.menu.opt.o3purestd.build.flags.ldspecs= -#teensy41.menu.opt.o3lto=Fastest with LTO -#teensy41.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects -#teensy41.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin -#teensy41.menu.opt.o3purelto=Fastest + pure-code with LTO -#teensy41.menu.opt.o3purelto.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -flto -fno-fat-lto-objects -#teensy41.menu.opt.o3purelto.build.flags.ldspecs=-fuse-linker-plugin -teensy41.menu.opt.ogstd=Debug -teensy41.menu.opt.ogstd.build.flags.optimize=-Og -teensy41.menu.opt.ogstd.build.flags.ldspecs= -#teensy41.menu.opt.oglto=Debug with LTO -#teensy41.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects -#teensy41.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin -teensy41.menu.opt.osstd=Smallest Code -teensy41.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs -teensy41.menu.opt.osstd.build.flags.ldspecs= -#teensy41.menu.opt.oslto=Smallest Code with LTO -#teensy41.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs -#teensy41.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin - -teensy41.menu.keys.en-us=US English -teensy41.menu.keys.en-us.build.keylayout=US_ENGLISH -teensy41.menu.keys.fr-ca=Canadian French -teensy41.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensy41.menu.keys.xx-ca=Canadian Multilingual -teensy41.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensy41.menu.keys.cz-cz=Czech -teensy41.menu.keys.cz-cz.build.keylayout=CZECH -teensy41.menu.keys.da-da=Danish -teensy41.menu.keys.da-da.build.keylayout=DANISH -teensy41.menu.keys.fi-fi=Finnish -teensy41.menu.keys.fi-fi.build.keylayout=FINNISH -teensy41.menu.keys.fr-fr=French -teensy41.menu.keys.fr-fr.build.keylayout=FRENCH -teensy41.menu.keys.fr-be=French Belgian -teensy41.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensy41.menu.keys.fr-ch=French Swiss -teensy41.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensy41.menu.keys.de-de=German -teensy41.menu.keys.de-de.build.keylayout=GERMAN -teensy41.menu.keys.de-dm=German (Mac) -teensy41.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensy41.menu.keys.de-ch=German Swiss -teensy41.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensy41.menu.keys.is-is=Icelandic -teensy41.menu.keys.is-is.build.keylayout=ICELANDIC -teensy41.menu.keys.en-ie=Irish -teensy41.menu.keys.en-ie.build.keylayout=IRISH -teensy41.menu.keys.it-it=Italian -teensy41.menu.keys.it-it.build.keylayout=ITALIAN -teensy41.menu.keys.no-no=Norwegian -teensy41.menu.keys.no-no.build.keylayout=NORWEGIAN -teensy41.menu.keys.pt-pt=Portuguese -teensy41.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensy41.menu.keys.pt-br=Portuguese Brazilian -teensy41.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensy41.menu.keys.rs-rs=Serbian (Latin Only) -teensy41.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensy41.menu.keys.es-es=Spanish -teensy41.menu.keys.es-es.build.keylayout=SPANISH -teensy41.menu.keys.es-mx=Spanish Latin America -teensy41.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensy41.menu.keys.sv-se=Swedish -teensy41.menu.keys.sv-se.build.keylayout=SWEDISH -teensy41.menu.keys.tr-tr=Turkish (partial) -teensy41.menu.keys.tr-tr.build.keylayout=TURKISH -teensy41.menu.keys.en-gb=United Kingdom -teensy41.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensy41.menu.keys.usint=US International -teensy41.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - - -teensy40.name=Teensy 4.0 -teensy40.upload.maximum_size=2031616 -teensy40.build.board=TEENSY40 -teensy40.build.flags.ld=-Wl,--gc-sections,--relax "-T{build.core.path}/imxrt1062.ld" -teensy40.upload.maximum_data_size=524288 -#teensy40.upload.maximum_data_size=1048576 -teensy40.upload.tool=teensyloader -teensy40.upload.protocol=halfkay -teensy40.build.core=teensy4 -teensy40.build.mcu=imxrt1062 -teensy40.build.warn_data_percentage=99 -teensy40.build.toolchain=arm/bin/ -teensy40.build.command.gcc=arm-none-eabi-gcc -teensy40.build.command.g++=arm-none-eabi-g++ -teensy40.build.command.ar=arm-none-eabi-gcc-ar -teensy40.build.command.objcopy=arm-none-eabi-objcopy -teensy40.build.command.objdump=arm-none-eabi-objdump -teensy40.build.command.linker=arm-none-eabi-gcc -teensy40.build.command.size=arm-none-eabi-size -teensy40.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -teensy40.build.flags.dep=-MMD -teensy40.build.flags.optimize=-Os -teensy40.build.flags.cpu=-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -teensy40.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=153 -teensy40.build.flags.cpp=-std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -teensy40.build.flags.c= -teensy40.build.flags.S=-x assembler-with-cpp -teensy40.build.flags.libs=-larm_cortexM7lfsp_math -lm -lstdc++ -teensy40.serial.restart_cmd=false -teensy40.menu.usb.serial=Serial -teensy40.menu.usb.serial.build.usbtype=USB_SERIAL -teensy40.menu.usb.serial2=Dual Serial -teensy40.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL -teensy40.menu.usb.serial3=Triple Serial -teensy40.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL -teensy40.menu.usb.keyboard=Keyboard -teensy40.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY -teensy40.menu.usb.keyboard.fake_serial=teensy_gateway -teensy40.menu.usb.touch=Keyboard + Touch Screen -teensy40.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN -teensy40.menu.usb.touch.fake_serial=teensy_gateway -teensy40.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen -teensy40.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN -teensy40.menu.usb.hidtouch.fake_serial=teensy_gateway -teensy40.menu.usb.hid=Keyboard + Mouse + Joystick -teensy40.menu.usb.hid.build.usbtype=USB_HID -teensy40.menu.usb.hid.fake_serial=teensy_gateway -teensy40.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensy40.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensy40.menu.usb.midi=MIDI -teensy40.menu.usb.midi.build.usbtype=USB_MIDI -teensy40.menu.usb.midi.fake_serial=teensy_gateway -teensy40.menu.usb.midi4=MIDIx4 -teensy40.menu.usb.midi4.build.usbtype=USB_MIDI4 -teensy40.menu.usb.midi4.fake_serial=teensy_gateway -teensy40.menu.usb.midi16=MIDIx16 -teensy40.menu.usb.midi16.build.usbtype=USB_MIDI16 -teensy40.menu.usb.midi16.fake_serial=teensy_gateway -teensy40.menu.usb.serialmidi=Serial + MIDI -teensy40.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL -teensy40.menu.usb.serialmidi4=Serial + MIDIx4 -teensy40.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL -teensy40.menu.usb.serialmidi16=Serial + MIDIx16 -teensy40.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL -teensy40.menu.usb.audio=Audio -teensy40.menu.usb.audio.build.usbtype=USB_AUDIO -teensy40.menu.usb.audio.fake_serial=teensy_gateway -teensy40.menu.usb.serialmidiaudio=Serial + MIDI + Audio -teensy40.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL -teensy40.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio -teensy40.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL -teensy40.menu.usb.mtp=MTP Disk (Experimental) -teensy40.menu.usb.mtp.build.usbtype=USB_MTPDISK -teensy40.menu.usb.mtp.fake_serial=teensy_gateway -teensy40.menu.usb.rawhid=Raw HID -teensy40.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensy40.menu.usb.rawhid.fake_serial=teensy_gateway -teensy40.menu.usb.flightsim=Flight Sim Controls -teensy40.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensy40.menu.usb.flightsim.fake_serial=teensy_gateway -teensy40.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick -teensy40.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK -teensy40.menu.usb.flightsimjoystick.fake_serial=teensy_gateway -#teensy40.menu.usb.disable=No USB -#teensy40.menu.usb.disable.build.usbtype=USB_DISABLED - -teensy40.menu.speed.600=600 MHz -teensy40.menu.speed.528=528 MHz -teensy40.menu.speed.450=450 MHz -teensy40.menu.speed.396=396 MHz -teensy40.menu.speed.150=150 MHz -teensy40.menu.speed.24=24 MHz -teensy40.menu.speed.720=720 MHz (overclock) -teensy40.menu.speed.816=816 MHz (overclock) -teensy40.menu.speed.912=912 MHz (overclock, cooling req'd) -teensy40.menu.speed.960=960 MHz (overclock, cooling req'd) -teensy40.menu.speed.1008=1.008 GHz (overclock, cooling req'd) -teensy40.menu.speed.1008.build.fcpu=1008000000 -teensy40.menu.speed.960.build.fcpu=960000000 -teensy40.menu.speed.912.build.fcpu=912000000 -teensy40.menu.speed.816.build.fcpu=816000000 -teensy40.menu.speed.720.build.fcpu=720000000 -teensy40.menu.speed.600.build.fcpu=600000000 -teensy40.menu.speed.528.build.fcpu=528000000 -teensy40.menu.speed.450.build.fcpu=450000000 -teensy40.menu.speed.396.build.fcpu=396000000 -teensy40.menu.speed.150.build.fcpu=150000000 -teensy40.menu.speed.24.build.fcpu=24000000 - -teensy40.menu.opt.o2std=Faster -teensy40.menu.opt.o2std.build.flags.optimize=-O2 -teensy40.menu.opt.o2std.build.flags.ldspecs= -#teensy40.menu.opt.o2lto=Faster with LTO -#teensy40.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects -#teensy40.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin -teensy40.menu.opt.o1std=Fast -teensy40.menu.opt.o1std.build.flags.optimize=-O1 -teensy40.menu.opt.o1std.build.flags.ldspecs= -#teensy40.menu.opt.o1lto=Fast with LTO -#teensy40.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects -#teensy40.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin -teensy40.menu.opt.o3std=Fastest -teensy40.menu.opt.o3std.build.flags.optimize=-O3 -teensy40.menu.opt.o3std.build.flags.ldspecs= -#teensy40.menu.opt.o3purestd=Fastest + pure-code -#teensy40.menu.opt.o3purestd.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -#teensy40.menu.opt.o3purestd.build.flags.ldspecs= -#teensy40.menu.opt.o3lto=Fastest with LTO -#teensy40.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects -#teensy40.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin -#teensy40.menu.opt.o3purelto=Fastest + pure-code with LTO -#teensy40.menu.opt.o3purelto.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -flto -fno-fat-lto-objects -#teensy40.menu.opt.o3purelto.build.flags.ldspecs=-fuse-linker-plugin -teensy40.menu.opt.ogstd=Debug -teensy40.menu.opt.ogstd.build.flags.optimize=-Og -teensy40.menu.opt.ogstd.build.flags.ldspecs= -#teensy40.menu.opt.oglto=Debug with LTO -#teensy40.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects -#teensy40.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin -teensy40.menu.opt.osstd=Smallest Code -teensy40.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs -teensy40.menu.opt.osstd.build.flags.ldspecs= -#teensy40.menu.opt.oslto=Smallest Code with LTO -#teensy40.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs -#teensy40.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin - -teensy40.menu.keys.en-us=US English -teensy40.menu.keys.en-us.build.keylayout=US_ENGLISH -teensy40.menu.keys.fr-ca=Canadian French -teensy40.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensy40.menu.keys.xx-ca=Canadian Multilingual -teensy40.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensy40.menu.keys.cz-cz=Czech -teensy40.menu.keys.cz-cz.build.keylayout=CZECH -teensy40.menu.keys.da-da=Danish -teensy40.menu.keys.da-da.build.keylayout=DANISH -teensy40.menu.keys.fi-fi=Finnish -teensy40.menu.keys.fi-fi.build.keylayout=FINNISH -teensy40.menu.keys.fr-fr=French -teensy40.menu.keys.fr-fr.build.keylayout=FRENCH -teensy40.menu.keys.fr-be=French Belgian -teensy40.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensy40.menu.keys.fr-ch=French Swiss -teensy40.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensy40.menu.keys.de-de=German -teensy40.menu.keys.de-de.build.keylayout=GERMAN -teensy40.menu.keys.de-dm=German (Mac) -teensy40.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensy40.menu.keys.de-ch=German Swiss -teensy40.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensy40.menu.keys.is-is=Icelandic -teensy40.menu.keys.is-is.build.keylayout=ICELANDIC -teensy40.menu.keys.en-ie=Irish -teensy40.menu.keys.en-ie.build.keylayout=IRISH -teensy40.menu.keys.it-it=Italian -teensy40.menu.keys.it-it.build.keylayout=ITALIAN -teensy40.menu.keys.no-no=Norwegian -teensy40.menu.keys.no-no.build.keylayout=NORWEGIAN -teensy40.menu.keys.pt-pt=Portuguese -teensy40.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensy40.menu.keys.pt-br=Portuguese Brazilian -teensy40.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensy40.menu.keys.rs-rs=Serbian (Latin Only) -teensy40.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensy40.menu.keys.es-es=Spanish -teensy40.menu.keys.es-es.build.keylayout=SPANISH -teensy40.menu.keys.es-mx=Spanish Latin America -teensy40.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensy40.menu.keys.sv-se=Swedish -teensy40.menu.keys.sv-se.build.keylayout=SWEDISH -teensy40.menu.keys.tr-tr=Turkish (partial) -teensy40.menu.keys.tr-tr.build.keylayout=TURKISH -teensy40.menu.keys.en-gb=United Kingdom -teensy40.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensy40.menu.keys.usint=US International -teensy40.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - -teensy36.name=Teensy 3.6 -teensy36.upload.maximum_size=1048576 -teensy36.upload.maximum_data_size=262144 -teensy36.upload.tool=teensyloader -teensy36.upload.protocol=halfkay -teensy36.build.board=TEENSY36 -teensy36.build.core=teensy3 -teensy36.build.mcu=mk66fx1m0 -teensy36.build.warn_data_percentage=99 -teensy36.build.toolchain=arm/bin/ -teensy36.build.command.gcc=arm-none-eabi-gcc -teensy36.build.command.g++=arm-none-eabi-g++ -teensy36.build.command.ar=arm-none-eabi-gcc-ar -teensy36.build.command.objcopy=arm-none-eabi-objcopy -teensy36.build.command.objdump=arm-none-eabi-objdump -teensy36.build.command.linker=arm-none-eabi-gcc -teensy36.build.command.size=arm-none-eabi-size -teensy36.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -teensy36.build.flags.dep=-MMD -teensy36.build.flags.optimize=-Os -teensy36.build.flags.cpu=-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -teensy36.build.flags.defs=-D__MK66FX1M0__ -DTEENSYDUINO=153 -teensy36.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -teensy36.build.flags.c= -teensy36.build.flags.S=-x assembler-with-cpp -teensy36.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk66fx1m0.ld" -teensy36.build.flags.libs=-larm_cortexM4lf_math -lm -lstdc++ -teensy36.serial.restart_cmd=false -teensy36.menu.usb.serial=Serial -teensy36.menu.usb.serial.build.usbtype=USB_SERIAL -teensy36.menu.usb.serial2=Dual Serial -teensy36.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL -teensy36.menu.usb.serial3=Triple Serial -teensy36.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL -teensy36.menu.usb.keyboard=Keyboard -teensy36.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY -teensy36.menu.usb.keyboard.fake_serial=teensy_gateway -teensy36.menu.usb.touch=Keyboard + Touch Screen -teensy36.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN -teensy36.menu.usb.touch.fake_serial=teensy_gateway -teensy36.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen -teensy36.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN -teensy36.menu.usb.hidtouch.fake_serial=teensy_gateway -teensy36.menu.usb.hid=Keyboard + Mouse + Joystick -teensy36.menu.usb.hid.build.usbtype=USB_HID -teensy36.menu.usb.hid.fake_serial=teensy_gateway -teensy36.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensy36.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensy36.menu.usb.midi=MIDI -teensy36.menu.usb.midi.build.usbtype=USB_MIDI -teensy36.menu.usb.midi.fake_serial=teensy_gateway -teensy36.menu.usb.midi4=MIDIx4 -teensy36.menu.usb.midi4.build.usbtype=USB_MIDI4 -teensy36.menu.usb.midi4.fake_serial=teensy_gateway -teensy36.menu.usb.midi16=MIDIx16 -teensy36.menu.usb.midi16.build.usbtype=USB_MIDI16 -teensy36.menu.usb.midi16.fake_serial=teensy_gateway -teensy36.menu.usb.serialmidi=Serial + MIDI -teensy36.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL -teensy36.menu.usb.serialmidi4=Serial + MIDIx4 -teensy36.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL -teensy36.menu.usb.serialmidi16=Serial + MIDIx16 -teensy36.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL -teensy36.menu.usb.audio=Audio -teensy36.menu.usb.audio.build.usbtype=USB_AUDIO -teensy36.menu.usb.audio.fake_serial=teensy_gateway -teensy36.menu.usb.serialmidiaudio=Serial + MIDI + Audio -teensy36.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL -teensy36.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio -teensy36.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL -teensy36.menu.usb.mtp=MTP Disk (Experimental) -teensy36.menu.usb.mtp.build.usbtype=USB_MTPDISK -teensy36.menu.usb.mtp.fake_serial=teensy_gateway -teensy36.menu.usb.rawhid=Raw HID -teensy36.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensy36.menu.usb.rawhid.fake_serial=teensy_gateway -teensy36.menu.usb.flightsim=Flight Sim Controls -teensy36.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensy36.menu.usb.flightsim.fake_serial=teensy_gateway -teensy36.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick -teensy36.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK -teensy36.menu.usb.flightsimjoystick.fake_serial=teensy_gateway -teensy36.menu.usb.everything=All of the Above -teensy36.menu.usb.everything.build.usbtype=USB_EVERYTHING -teensy36.menu.usb.disable=No USB -teensy36.menu.usb.disable.build.usbtype=USB_DISABLED - -teensy36.menu.speed.180=180 MHz -teensy36.menu.speed.168=168 MHz -teensy36.menu.speed.144=144 MHz -teensy36.menu.speed.120=120 MHz -teensy36.menu.speed.96=96 MHz -teensy36.menu.speed.72=72 MHz -teensy36.menu.speed.48=48 MHz -teensy36.menu.speed.24=24 MHz -teensy36.menu.speed.16=16 MHz (No USB) -teensy36.menu.speed.8=8 MHz (No USB) -teensy36.menu.speed.4=4 MHz (No USB) -teensy36.menu.speed.2=2 MHz (No USB) -teensy36.menu.speed.192=192 MHz (overclock) -teensy36.menu.speed.216=216 MHz (overclock) -teensy36.menu.speed.240=240 MHz (overclock) -teensy36.menu.speed.256=256 MHz (overclock) -teensy36.menu.speed.256.build.fcpu=256000000 -teensy36.menu.speed.240.build.fcpu=240000000 -teensy36.menu.speed.216.build.fcpu=216000000 -teensy36.menu.speed.192.build.fcpu=192000000 -teensy36.menu.speed.180.build.fcpu=180000000 -teensy36.menu.speed.168.build.fcpu=168000000 -teensy36.menu.speed.144.build.fcpu=144000000 -teensy36.menu.speed.120.build.fcpu=120000000 -teensy36.menu.speed.96.build.fcpu=96000000 -teensy36.menu.speed.72.build.fcpu=72000000 -teensy36.menu.speed.48.build.fcpu=48000000 -teensy36.menu.speed.24.build.fcpu=24000000 -teensy36.menu.speed.16.build.fcpu=16000000 -teensy36.menu.speed.8.build.fcpu=8000000 -teensy36.menu.speed.4.build.fcpu=4000000 -teensy36.menu.speed.2.build.fcpu=2000000 - -teensy36.menu.opt.o2std=Faster -teensy36.menu.opt.o2std.build.flags.optimize=-O2 -teensy36.menu.opt.o2std.build.flags.ldspecs= -teensy36.menu.opt.o2lto=Faster with LTO -teensy36.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects -teensy36.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin -teensy36.menu.opt.o1std=Fast -teensy36.menu.opt.o1std.build.flags.optimize=-O1 -teensy36.menu.opt.o1std.build.flags.ldspecs= -teensy36.menu.opt.o1lto=Fast with LTO -teensy36.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects -teensy36.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin -teensy36.menu.opt.o3std=Fastest -teensy36.menu.opt.o3std.build.flags.optimize=-O3 -teensy36.menu.opt.o3std.build.flags.ldspecs= -teensy36.menu.opt.o3purestd=Fastest + pure-code -teensy36.menu.opt.o3purestd.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -teensy36.menu.opt.o3purestd.build.flags.ldspecs= -teensy36.menu.opt.o3lto=Fastest with LTO -teensy36.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects -teensy36.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin -teensy36.menu.opt.o3purelto=Fastest + pure-code with LTO -teensy36.menu.opt.o3purelto.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -flto -fno-fat-lto-objects -teensy36.menu.opt.o3purelto.build.flags.ldspecs=-fuse-linker-plugin -teensy36.menu.opt.ogstd=Debug -teensy36.menu.opt.ogstd.build.flags.optimize=-Og -teensy36.menu.opt.ogstd.build.flags.ldspecs= -teensy36.menu.opt.oglto=Debug with LTO -teensy36.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects -teensy36.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin -teensy36.menu.opt.osstd=Smallest Code -teensy36.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs -teensy36.menu.opt.osstd.build.flags.ldspecs= -teensy36.menu.opt.oslto=Smallest Code with LTO -teensy36.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs -teensy36.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin - -teensy36.menu.keys.en-us=US English -teensy36.menu.keys.en-us.build.keylayout=US_ENGLISH -teensy36.menu.keys.fr-ca=Canadian French -teensy36.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensy36.menu.keys.xx-ca=Canadian Multilingual -teensy36.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensy36.menu.keys.cz-cz=Czech -teensy36.menu.keys.cz-cz.build.keylayout=CZECH -teensy36.menu.keys.da-da=Danish -teensy36.menu.keys.da-da.build.keylayout=DANISH -teensy36.menu.keys.fi-fi=Finnish -teensy36.menu.keys.fi-fi.build.keylayout=FINNISH -teensy36.menu.keys.fr-fr=French -teensy36.menu.keys.fr-fr.build.keylayout=FRENCH -teensy36.menu.keys.fr-be=French Belgian -teensy36.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensy36.menu.keys.fr-ch=French Swiss -teensy36.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensy36.menu.keys.de-de=German -teensy36.menu.keys.de-de.build.keylayout=GERMAN -teensy36.menu.keys.de-dm=German (Mac) -teensy36.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensy36.menu.keys.de-ch=German Swiss -teensy36.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensy36.menu.keys.is-is=Icelandic -teensy36.menu.keys.is-is.build.keylayout=ICELANDIC -teensy36.menu.keys.en-ie=Irish -teensy36.menu.keys.en-ie.build.keylayout=IRISH -teensy36.menu.keys.it-it=Italian -teensy36.menu.keys.it-it.build.keylayout=ITALIAN -teensy36.menu.keys.no-no=Norwegian -teensy36.menu.keys.no-no.build.keylayout=NORWEGIAN -teensy36.menu.keys.pt-pt=Portuguese -teensy36.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensy36.menu.keys.pt-br=Portuguese Brazilian -teensy36.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensy36.menu.keys.rs-rs=Serbian (Latin Only) -teensy36.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensy36.menu.keys.es-es=Spanish -teensy36.menu.keys.es-es.build.keylayout=SPANISH -teensy36.menu.keys.es-mx=Spanish Latin America -teensy36.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensy36.menu.keys.sv-se=Swedish -teensy36.menu.keys.sv-se.build.keylayout=SWEDISH -teensy36.menu.keys.tr-tr=Turkish (partial) -teensy36.menu.keys.tr-tr.build.keylayout=TURKISH -teensy36.menu.keys.en-gb=United Kingdom -teensy36.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensy36.menu.keys.usint=US International -teensy36.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - -teensy35.name=Teensy 3.5 -teensy35.upload.maximum_size=524288 -teensy35.upload.maximum_data_size=262136 -teensy35.upload.tool=teensyloader -teensy35.upload.protocol=halfkay -teensy35.build.board=TEENSY35 -teensy35.build.core=teensy3 -teensy35.build.mcu=mk64fx512 -teensy35.build.warn_data_percentage=98 -teensy35.build.toolchain=arm/bin/ -teensy35.build.command.gcc=arm-none-eabi-gcc -teensy35.build.command.g++=arm-none-eabi-g++ -teensy35.build.command.ar=arm-none-eabi-gcc-ar -teensy35.build.command.objcopy=arm-none-eabi-objcopy -teensy35.build.command.objdump=arm-none-eabi-objdump -teensy35.build.command.linker=arm-none-eabi-gcc -teensy35.build.command.size=arm-none-eabi-size -teensy35.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -teensy35.build.flags.dep=-MMD -teensy35.build.flags.optimize=-Os -teensy35.build.flags.cpu=-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -teensy35.build.flags.defs=-D__MK64FX512__ -DTEENSYDUINO=153 -teensy35.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -teensy35.build.flags.c= -teensy35.build.flags.S=-x assembler-with-cpp -teensy35.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk64fx512.ld" -teensy35.build.flags.libs=-larm_cortexM4lf_math -lm -lstdc++ -teensy35.serial.restart_cmd=false -teensy35.menu.usb.serial=Serial -teensy35.menu.usb.serial.build.usbtype=USB_SERIAL -teensy35.menu.usb.serial2=Dual Serial -teensy35.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL -teensy35.menu.usb.serial3=Triple Serial -teensy35.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL -teensy35.menu.usb.keyboard=Keyboard -teensy35.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY -teensy35.menu.usb.keyboard.fake_serial=teensy_gateway -teensy35.menu.usb.touch=Keyboard + Touch Screen -teensy35.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN -teensy35.menu.usb.touch.fake_serial=teensy_gateway -teensy35.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen -teensy35.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN -teensy35.menu.usb.hidtouch.fake_serial=teensy_gateway -teensy35.menu.usb.hid=Keyboard + Mouse + Joystick -teensy35.menu.usb.hid.build.usbtype=USB_HID -teensy35.menu.usb.hid.fake_serial=teensy_gateway -teensy35.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensy35.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensy35.menu.usb.midi=MIDI -teensy35.menu.usb.midi.build.usbtype=USB_MIDI -teensy35.menu.usb.midi.fake_serial=teensy_gateway -teensy35.menu.usb.midi4=MIDIx4 -teensy35.menu.usb.midi4.build.usbtype=USB_MIDI4 -teensy35.menu.usb.midi4.fake_serial=teensy_gateway -teensy35.menu.usb.midi16=MIDIx16 -teensy35.menu.usb.midi16.build.usbtype=USB_MIDI16 -teensy35.menu.usb.midi16.fake_serial=teensy_gateway -teensy35.menu.usb.serialmidi=Serial + MIDI -teensy35.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL -teensy35.menu.usb.serialmidi4=Serial + MIDIx4 -teensy35.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL -teensy35.menu.usb.serialmidi16=Serial + MIDIx16 -teensy35.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL -teensy35.menu.usb.audio=Audio -teensy35.menu.usb.audio.build.usbtype=USB_AUDIO -teensy35.menu.usb.audio.fake_serial=teensy_gateway -teensy35.menu.usb.serialmidiaudio=Serial + MIDI + Audio -teensy35.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL -teensy35.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio -teensy35.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL -teensy35.menu.usb.mtp=MTP Disk (Experimental) -teensy35.menu.usb.mtp.build.usbtype=USB_MTPDISK -teensy35.menu.usb.mtp.fake_serial=teensy_gateway -teensy35.menu.usb.rawhid=Raw HID -teensy35.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensy35.menu.usb.rawhid.fake_serial=teensy_gateway -teensy35.menu.usb.flightsim=Flight Sim Controls -teensy35.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensy35.menu.usb.flightsim.fake_serial=teensy_gateway -teensy35.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick -teensy35.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK -teensy35.menu.usb.flightsimjoystick.fake_serial=teensy_gateway -teensy35.menu.usb.everything=All of the Above -teensy35.menu.usb.everything.build.usbtype=USB_EVERYTHING -teensy35.menu.usb.disable=No USB -teensy35.menu.usb.disable.build.usbtype=USB_DISABLED - -teensy35.menu.speed.120=120 MHz -teensy35.menu.speed.96=96 MHz -teensy35.menu.speed.72=72 MHz -teensy35.menu.speed.48=48 MHz -teensy35.menu.speed.24=24 MHz -teensy35.menu.speed.16=16 MHz (No USB) -teensy35.menu.speed.8=8 MHz (No USB) -teensy35.menu.speed.4=4 MHz (No USB) -teensy35.menu.speed.2=2 MHz (No USB) -teensy35.menu.speed.144=144 MHz (overclock) -teensy35.menu.speed.168=168 MHz (overclock) -teensy35.menu.speed.168.build.fcpu=168000000 -teensy35.menu.speed.144.build.fcpu=144000000 -teensy35.menu.speed.120.build.fcpu=120000000 -teensy35.menu.speed.96.build.fcpu=96000000 -teensy35.menu.speed.72.build.fcpu=72000000 -teensy35.menu.speed.48.build.fcpu=48000000 -teensy35.menu.speed.24.build.fcpu=24000000 -teensy35.menu.speed.16.build.fcpu=16000000 -teensy35.menu.speed.8.build.fcpu=8000000 -teensy35.menu.speed.4.build.fcpu=4000000 -teensy35.menu.speed.2.build.fcpu=2000000 - -teensy35.menu.opt.o2std=Faster -teensy35.menu.opt.o2std.build.flags.optimize=-O2 -teensy35.menu.opt.o2std.build.flags.ldspecs= -teensy35.menu.opt.o2lto=Faster with LTO -teensy35.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects -teensy35.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin -teensy35.menu.opt.o1std=Fast -teensy35.menu.opt.o1std.build.flags.optimize=-O1 -teensy35.menu.opt.o1std.build.flags.ldspecs= -teensy35.menu.opt.o1lto=Fast with LTO -teensy35.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects -teensy35.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin -teensy35.menu.opt.o3std=Fastest -teensy35.menu.opt.o3std.build.flags.optimize=-O3 -teensy35.menu.opt.o3std.build.flags.ldspecs= -teensy35.menu.opt.o3purestd=Fastest + pure-code -teensy35.menu.opt.o3purestd.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -teensy35.menu.opt.o3purestd.build.flags.ldspecs= -teensy35.menu.opt.o3lto=Fastest with LTO -teensy35.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects -teensy35.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin -teensy35.menu.opt.o3purelto=Fastest + pure-code with LTO -teensy35.menu.opt.o3purelto.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -flto -fno-fat-lto-objects -teensy35.menu.opt.o3purelto.build.flags.ldspecs=-fuse-linker-plugin -teensy35.menu.opt.ogstd=Debug -teensy35.menu.opt.ogstd.build.flags.optimize=-Og -teensy35.menu.opt.ogstd.build.flags.ldspecs= -teensy35.menu.opt.oglto=Debug with LTO -teensy35.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects -teensy35.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin -teensy35.menu.opt.osstd=Smallest Code -teensy35.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs -teensy35.menu.opt.osstd.build.flags.ldspecs= -teensy35.menu.opt.oslto=Smallest Code with LTO -teensy35.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs -teensy35.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin - -teensy35.menu.keys.en-us=US English -teensy35.menu.keys.en-us.build.keylayout=US_ENGLISH -teensy35.menu.keys.fr-ca=Canadian French -teensy35.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensy35.menu.keys.xx-ca=Canadian Multilingual -teensy35.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensy35.menu.keys.cz-cz=Czech -teensy35.menu.keys.cz-cz.build.keylayout=CZECH -teensy35.menu.keys.da-da=Danish -teensy35.menu.keys.da-da.build.keylayout=DANISH -teensy35.menu.keys.fi-fi=Finnish -teensy35.menu.keys.fi-fi.build.keylayout=FINNISH -teensy35.menu.keys.fr-fr=French -teensy35.menu.keys.fr-fr.build.keylayout=FRENCH -teensy35.menu.keys.fr-be=French Belgian -teensy35.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensy35.menu.keys.fr-ch=French Swiss -teensy35.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensy35.menu.keys.de-de=German -teensy35.menu.keys.de-de.build.keylayout=GERMAN -teensy35.menu.keys.de-dm=German (Mac) -teensy35.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensy35.menu.keys.de-ch=German Swiss -teensy35.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensy35.menu.keys.is-is=Icelandic -teensy35.menu.keys.is-is.build.keylayout=ICELANDIC -teensy35.menu.keys.en-ie=Irish -teensy35.menu.keys.en-ie.build.keylayout=IRISH -teensy35.menu.keys.it-it=Italian -teensy35.menu.keys.it-it.build.keylayout=ITALIAN -teensy35.menu.keys.no-no=Norwegian -teensy35.menu.keys.no-no.build.keylayout=NORWEGIAN -teensy35.menu.keys.pt-pt=Portuguese -teensy35.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensy35.menu.keys.pt-br=Portuguese Brazilian -teensy35.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensy35.menu.keys.rs-rs=Serbian (Latin Only) -teensy35.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensy35.menu.keys.es-es=Spanish -teensy35.menu.keys.es-es.build.keylayout=SPANISH -teensy35.menu.keys.es-mx=Spanish Latin America -teensy35.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensy35.menu.keys.sv-se=Swedish -teensy35.menu.keys.sv-se.build.keylayout=SWEDISH -teensy35.menu.keys.tr-tr=Turkish (partial) -teensy35.menu.keys.tr-tr.build.keylayout=TURKISH -teensy35.menu.keys.en-gb=United Kingdom -teensy35.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensy35.menu.keys.usint=US International -teensy35.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - -teensy31.name=Teensy 3.2 / 3.1 -teensy31.upload.maximum_size=262144 -teensy31.upload.maximum_data_size=65536 -teensy31.upload.tool=teensyloader -teensy31.upload.protocol=halfkay -teensy31.build.board=TEENSY32 -teensy31.build.core=teensy3 -teensy31.build.mcu=mk20dx256 -teensy31.build.warn_data_percentage=97 -teensy31.build.toolchain=arm/bin/ -teensy31.build.command.gcc=arm-none-eabi-gcc -teensy31.build.command.g++=arm-none-eabi-g++ -teensy31.build.command.ar=arm-none-eabi-gcc-ar -teensy31.build.command.objcopy=arm-none-eabi-objcopy -teensy31.build.command.objdump=arm-none-eabi-objdump -teensy31.build.command.linker=arm-none-eabi-gcc -teensy31.build.command.size=arm-none-eabi-size -teensy31.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -teensy31.build.flags.dep=-MMD -teensy31.build.flags.optimize=-Os -teensy31.build.flags.cpu=-mthumb -mcpu=cortex-m4 -fsingle-precision-constant -teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=153 -teensy31.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -teensy31.build.flags.c= -teensy31.build.flags.S=-x assembler-with-cpp -teensy31.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk20dx256.ld" -teensy31.build.flags.libs=-larm_cortexM4l_math -lm -lstdc++ -teensy31.serial.restart_cmd=false -teensy31.menu.usb.serial=Serial -teensy31.menu.usb.serial.build.usbtype=USB_SERIAL -teensy31.menu.usb.serial2=Dual Serial -teensy31.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL -teensy31.menu.usb.serial3=Triple Serial -teensy31.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL -teensy31.menu.usb.keyboard=Keyboard -teensy31.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY -teensy31.menu.usb.keyboard.fake_serial=teensy_gateway -teensy31.menu.usb.touch=Keyboard + Touch Screen -teensy31.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN -teensy31.menu.usb.touch.fake_serial=teensy_gateway -teensy31.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen -teensy31.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN -teensy31.menu.usb.hidtouch.fake_serial=teensy_gateway -teensy31.menu.usb.hid=Keyboard + Mouse + Joystick -teensy31.menu.usb.hid.build.usbtype=USB_HID -teensy31.menu.usb.hid.fake_serial=teensy_gateway -teensy31.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensy31.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensy31.menu.usb.midi=MIDI -teensy31.menu.usb.midi.build.usbtype=USB_MIDI -teensy31.menu.usb.midi.fake_serial=teensy_gateway -teensy31.menu.usb.midi4=MIDIx4 -teensy31.menu.usb.midi4.build.usbtype=USB_MIDI4 -teensy31.menu.usb.midi4.fake_serial=teensy_gateway -teensy31.menu.usb.midi16=MIDIx16 -teensy31.menu.usb.midi16.build.usbtype=USB_MIDI16 -teensy31.menu.usb.midi16.fake_serial=teensy_gateway -teensy31.menu.usb.serialmidi=Serial + MIDI -teensy31.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL -teensy31.menu.usb.serialmidi4=Serial + MIDIx4 -teensy31.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL -teensy31.menu.usb.serialmidi16=Serial + MIDIx16 -teensy31.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL -teensy31.menu.usb.audio=Audio -teensy31.menu.usb.audio.build.usbtype=USB_AUDIO -teensy31.menu.usb.audio.fake_serial=teensy_gateway -teensy31.menu.usb.serialmidiaudio=Serial + MIDI + Audio -teensy31.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL -teensy31.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio -teensy31.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL -teensy31.menu.usb.mtp=MTP Disk (Experimental) -teensy31.menu.usb.mtp.build.usbtype=USB_MTPDISK -teensy31.menu.usb.mtp.fake_serial=teensy_gateway -teensy31.menu.usb.rawhid=Raw HID -teensy31.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensy31.menu.usb.rawhid.fake_serial=teensy_gateway -teensy31.menu.usb.flightsim=Flight Sim Controls -teensy31.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensy31.menu.usb.flightsim.fake_serial=teensy_gateway -teensy31.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick -teensy31.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK -teensy31.menu.usb.flightsimjoystick.fake_serial=teensy_gateway -teensy31.menu.usb.everything=All of the Above -teensy31.menu.usb.everything.build.usbtype=USB_EVERYTHING -teensy31.menu.usb.disable=No USB -teensy31.menu.usb.disable.build.usbtype=USB_DISABLED - -teensy31.menu.speed.96=96 MHz (overclock) -teensy31.menu.speed.72=72 MHz -teensy31.menu.speed.48=48 MHz -teensy31.menu.speed.24=24 MHz -teensy31.menu.speed.16=16 MHz (No USB) -teensy31.menu.speed.8=8 MHz (No USB) -teensy31.menu.speed.4=4 MHz (No USB) -teensy31.menu.speed.2=2 MHz (No USB) -teensy31.menu.speed.120=120 MHz (overclock) -#uncomment these if you want to try faster overclocking -#teensy31.menu.speed.144=144 MHz (overclock) -#teensy31.menu.speed.168=168 MHz (overclock) -teensy31.menu.speed.168.build.fcpu=168000000 -teensy31.menu.speed.144.build.fcpu=144000000 -teensy31.menu.speed.120.build.fcpu=120000000 -teensy31.menu.speed.96.build.fcpu=96000000 -teensy31.menu.speed.72.build.fcpu=72000000 -teensy31.menu.speed.48.build.fcpu=48000000 -teensy31.menu.speed.24.build.fcpu=24000000 -teensy31.menu.speed.16.build.fcpu=16000000 -teensy31.menu.speed.8.build.fcpu=8000000 -teensy31.menu.speed.4.build.fcpu=4000000 -teensy31.menu.speed.2.build.fcpu=2000000 - -teensy31.menu.opt.o2std=Faster -teensy31.menu.opt.o2std.build.flags.optimize=-O2 -teensy31.menu.opt.o2std.build.flags.ldspecs= -teensy31.menu.opt.o2lto=Faster with LTO -teensy31.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects -teensy31.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin -teensy31.menu.opt.o1std=Fast -teensy31.menu.opt.o1std.build.flags.optimize=-O1 -teensy31.menu.opt.o1std.build.flags.ldspecs= -teensy31.menu.opt.o1lto=Fast with LTO -teensy31.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects -teensy31.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin -teensy31.menu.opt.o3std=Fastest -teensy31.menu.opt.o3std.build.flags.optimize=-O3 -teensy31.menu.opt.o3std.build.flags.ldspecs= -teensy31.menu.opt.o3purestd=Fastest + pure-code -teensy31.menu.opt.o3purestd.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -teensy31.menu.opt.o3purestd.build.flags.ldspecs= -teensy31.menu.opt.o3lto=Fastest with LTO -teensy31.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects -teensy31.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin -teensy31.menu.opt.o3purelto=Fastest + pure-code with LTO -teensy31.menu.opt.o3purelto.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -flto -fno-fat-lto-objects -teensy31.menu.opt.o3purelto.build.flags.ldspecs=-fuse-linker-plugin -teensy31.menu.opt.ogstd=Debug -teensy31.menu.opt.ogstd.build.flags.optimize=-Og -teensy31.menu.opt.ogstd.build.flags.ldspecs= -teensy31.menu.opt.oglto=Debug with LTO -teensy31.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects -teensy31.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin -teensy31.menu.opt.osstd=Smallest Code -teensy31.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs -teensy31.menu.opt.osstd.build.flags.ldspecs= -teensy31.menu.opt.oslto=Smallest Code with LTO -teensy31.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs -teensy31.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin - -teensy31.menu.keys.en-us=US English -teensy31.menu.keys.en-us.build.keylayout=US_ENGLISH -teensy31.menu.keys.fr-ca=Canadian French -teensy31.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensy31.menu.keys.xx-ca=Canadian Multilingual -teensy31.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensy31.menu.keys.cz-cz=Czech -teensy31.menu.keys.cz-cz.build.keylayout=CZECH -teensy31.menu.keys.da-da=Danish -teensy31.menu.keys.da-da.build.keylayout=DANISH -teensy31.menu.keys.fi-fi=Finnish -teensy31.menu.keys.fi-fi.build.keylayout=FINNISH -teensy31.menu.keys.fr-fr=French -teensy31.menu.keys.fr-fr.build.keylayout=FRENCH -teensy31.menu.keys.fr-be=French Belgian -teensy31.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensy31.menu.keys.fr-ch=French Swiss -teensy31.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensy31.menu.keys.de-de=German -teensy31.menu.keys.de-de.build.keylayout=GERMAN -teensy31.menu.keys.de-dm=German (Mac) -teensy31.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensy31.menu.keys.de-ch=German Swiss -teensy31.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensy31.menu.keys.is-is=Icelandic -teensy31.menu.keys.is-is.build.keylayout=ICELANDIC -teensy31.menu.keys.en-ie=Irish -teensy31.menu.keys.en-ie.build.keylayout=IRISH -teensy31.menu.keys.it-it=Italian -teensy31.menu.keys.it-it.build.keylayout=ITALIAN -teensy31.menu.keys.no-no=Norwegian -teensy31.menu.keys.no-no.build.keylayout=NORWEGIAN -teensy31.menu.keys.pt-pt=Portuguese -teensy31.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensy31.menu.keys.pt-br=Portuguese Brazilian -teensy31.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensy31.menu.keys.rs-rs=Serbian (Latin Only) -teensy31.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensy31.menu.keys.es-es=Spanish -teensy31.menu.keys.es-es.build.keylayout=SPANISH -teensy31.menu.keys.es-mx=Spanish Latin America -teensy31.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensy31.menu.keys.sv-se=Swedish -teensy31.menu.keys.sv-se.build.keylayout=SWEDISH -teensy31.menu.keys.tr-tr=Turkish (partial) -teensy31.menu.keys.tr-tr.build.keylayout=TURKISH -teensy31.menu.keys.en-gb=United Kingdom -teensy31.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensy31.menu.keys.usint=US International -teensy31.menu.keys.usint.build.keylayout=US_INTERNATIONAL - -teensy31.vid.0=0x16C0 -teensy31.vid.1=0x16C0 -teensy31.vid.2=0x16C0 -teensy31.vid.3=0x16C0 -teensy31.vid.4=0x16C0 -teensy31.pid.0=0x0483 -teensy31.pid.1=0x0487 -teensy31.pid.2=0x0489 -teensy31.pid.3=0x048A -teensy31.pid.4=0x0476 - -teensy30.name=Teensy 3.0 -teensy30.upload.maximum_size=131072 -teensy30.upload.maximum_data_size=16384 -teensy30.upload.tool=teensyloader -teensy30.upload.protocol=halfkay -teensy30.build.board=TEENSY30 -teensy30.build.core=teensy3 -teensy30.build.mcu=mk20dx128 -teensy30.build.warn_data_percentage=94 -teensy30.build.toolchain=arm/bin/ -teensy30.build.command.gcc=arm-none-eabi-gcc -teensy30.build.command.g++=arm-none-eabi-g++ -teensy30.build.command.ar=arm-none-eabi-gcc-ar -teensy30.build.command.objcopy=arm-none-eabi-objcopy -teensy30.build.command.objdump=arm-none-eabi-objdump -teensy30.build.command.linker=arm-none-eabi-gcc -teensy30.build.command.size=arm-none-eabi-size -teensy30.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -teensy30.build.flags.dep=-MMD -teensy30.build.flags.optimize=-Os -teensy30.build.flags.cpu=-mthumb -mcpu=cortex-m4 -fsingle-precision-constant -teensy30.build.flags.defs=-D__MK20DX128__ -DTEENSYDUINO=153 -teensy30.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -teensy30.build.flags.c= -teensy30.build.flags.S=-x assembler-with-cpp -teensy30.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk20dx128.ld" -teensy30.build.flags.ldspecs=--specs=nano.specs -teensy30.build.flags.libs=-larm_cortexM4l_math -lm -lstdc++ -teensy30.serial.restart_cmd=false - -teensy30.menu.usb.serial=Serial -teensy30.menu.usb.serial.build.usbtype=USB_SERIAL -teensy30.menu.usb.keyboard=Keyboard -teensy30.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY -teensy30.menu.usb.keyboard.fake_serial=teensy_gateway -teensy30.menu.usb.hid=Keyboard + Mouse + Joystick -teensy30.menu.usb.hid.build.usbtype=USB_HID -teensy30.menu.usb.hid.fake_serial=teensy_gateway -teensy30.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensy30.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensy30.menu.usb.touch=Keyboard + Touch Screen -teensy30.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN -teensy30.menu.usb.touch.fake_serial=teensy_gateway -teensy30.menu.usb.midi=MIDI -teensy30.menu.usb.midi.build.usbtype=USB_MIDI -teensy30.menu.usb.midi.fake_serial=teensy_gateway -teensy30.menu.usb.midi4=MIDIx4 -teensy30.menu.usb.midi4.build.usbtype=USB_MIDI4 -teensy30.menu.usb.midi4.fake_serial=teensy_gateway -teensy30.menu.usb.serialmidi=Serial + MIDI -teensy30.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL -teensy30.menu.usb.serialmidi4=Serial + MIDIx4 -teensy30.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL -teensy30.menu.usb.audio=Audio -teensy30.menu.usb.audio.build.usbtype=USB_AUDIO -teensy30.menu.usb.audio.fake_serial=teensy_gateway -teensy30.menu.usb.serialmidiaudio=Serial + MIDI + Audio -teensy30.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL -teensy30.menu.usb.mtp=MTP Disk (Experimental) -teensy30.menu.usb.mtp.build.usbtype=USB_MTPDISK -teensy30.menu.usb.mtp.fake_serial=teensy_gateway -teensy30.menu.usb.rawhid=Raw HID -teensy30.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensy30.menu.usb.rawhid.fake_serial=teensy_gateway -teensy30.menu.usb.flightsim=Flight Sim Controls -teensy30.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensy30.menu.usb.flightsim.fake_serial=teensy_gateway -teensy30.menu.usb.disable=No USB -teensy30.menu.usb.disable.build.usbtype=USB_DISABLED - -teensy30.menu.speed.96=96 MHz (overclock) -teensy30.menu.speed.48=48 MHz -teensy30.menu.speed.24=24 MHz -teensy30.menu.speed.96.build.fcpu=96000000 -teensy30.menu.speed.48.build.fcpu=48000000 -teensy30.menu.speed.24.build.fcpu=24000000 - -teensy30.menu.opt.o2std=Faster -teensy30.menu.opt.o2std.build.flags.optimize=-O2 -teensy30.menu.opt.o2std.build.flags.ldspecs= -teensy30.menu.opt.o2lto=Faster with LTO -teensy30.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects -teensy30.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin -teensy30.menu.opt.o1std=Fast -teensy30.menu.opt.o1std.build.flags.optimize=-O1 -teensy30.menu.opt.o1std.build.flags.ldspecs= -teensy30.menu.opt.o1lto=Fast with LTO -teensy30.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects -teensy30.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin -teensy30.menu.opt.o3std=Fastest -teensy30.menu.opt.o3std.build.flags.optimize=-O3 -teensy30.menu.opt.o3std.build.flags.ldspecs= -teensy30.menu.opt.o3lto=Fastest with LTO -teensy30.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects -teensy30.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin -teensy30.menu.opt.ogstd=Debug -teensy30.menu.opt.ogstd.build.flags.optimize=-Og -teensy30.menu.opt.ogstd.build.flags.ldspecs= -teensy30.menu.opt.oglto=Debug with LTO -teensy30.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects -teensy30.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin -teensy30.menu.opt.osstd=Smallest Code -teensy30.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs -teensy30.menu.opt.osstd.build.flags.ldspecs= -teensy30.menu.opt.oslto=Smallest Code with LTO -teensy30.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs -teensy30.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin - -teensy30.menu.keys.en-us=US English -teensy30.menu.keys.en-us.build.keylayout=US_ENGLISH -teensy30.menu.keys.fr-ca=Canadian French -teensy30.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensy30.menu.keys.xx-ca=Canadian Multilingual -teensy30.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensy30.menu.keys.cz-cz=Czech -teensy30.menu.keys.cz-cz.build.keylayout=CZECH -teensy30.menu.keys.da-da=Danish -teensy30.menu.keys.da-da.build.keylayout=DANISH -teensy30.menu.keys.fi-fi=Finnish -teensy30.menu.keys.fi-fi.build.keylayout=FINNISH -teensy30.menu.keys.fr-fr=French -teensy30.menu.keys.fr-fr.build.keylayout=FRENCH -teensy30.menu.keys.fr-be=French Belgian -teensy30.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensy30.menu.keys.fr-ch=French Swiss -teensy30.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensy30.menu.keys.de-de=German -teensy30.menu.keys.de-de.build.keylayout=GERMAN -teensy30.menu.keys.de-dm=German (Mac) -teensy30.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensy30.menu.keys.de-ch=German Swiss -teensy30.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensy30.menu.keys.is-is=Icelandic -teensy30.menu.keys.is-is.build.keylayout=ICELANDIC -teensy30.menu.keys.en-ie=Irish -teensy30.menu.keys.en-ie.build.keylayout=IRISH -teensy30.menu.keys.it-it=Italian -teensy30.menu.keys.it-it.build.keylayout=ITALIAN -teensy30.menu.keys.no-no=Norwegian -teensy30.menu.keys.no-no.build.keylayout=NORWEGIAN -teensy30.menu.keys.pt-pt=Portuguese -teensy30.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensy30.menu.keys.pt-br=Portuguese Brazilian -teensy30.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensy30.menu.keys.rs-rs=Serbian (Latin Only) -teensy30.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensy30.menu.keys.es-es=Spanish -teensy30.menu.keys.es-es.build.keylayout=SPANISH -teensy30.menu.keys.es-mx=Spanish Latin America -teensy30.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensy30.menu.keys.sv-se=Swedish -teensy30.menu.keys.sv-se.build.keylayout=SWEDISH -teensy30.menu.keys.tr-tr=Turkish (partial) -teensy30.menu.keys.tr-tr.build.keylayout=TURKISH -teensy30.menu.keys.en-gb=United Kingdom -teensy30.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensy30.menu.keys.usint=US International -teensy30.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - -teensyLC.name=Teensy LC -teensyLC.upload.maximum_size=63488 -teensyLC.upload.maximum_data_size=8192 -teensyLC.upload.tool=teensyloader -teensyLC.upload.protocol=halfkay -teensyLC.build.board=TEENSYLC -teensyLC.build.core=teensy3 -teensyLC.build.mcu=mkl26z64 -teensyLC.build.warn_data_percentage=88 -teensyLC.build.toolchain=arm/bin/ -teensyLC.build.command.gcc=arm-none-eabi-gcc -teensyLC.build.command.g++=arm-none-eabi-g++ -teensyLC.build.command.ar=arm-none-eabi-gcc-ar -teensyLC.build.command.objcopy=arm-none-eabi-objcopy -teensyLC.build.command.objdump=arm-none-eabi-objdump -teensyLC.build.command.linker=arm-none-eabi-gcc -teensyLC.build.command.size=arm-none-eabi-size -teensyLC.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib -teensyLC.build.flags.dep=-MMD -teensyLC.build.flags.cpu=-mthumb -mcpu=cortex-m0plus -fsingle-precision-constant -teensyLC.build.flags.defs=-D__MKL26Z64__ -DTEENSYDUINO=153 -teensyLC.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -teensyLC.build.flags.c= -teensyLC.build.flags.S=-x assembler-with-cpp -teensyLC.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mkl26z64.ld" -teensyLC.build.flags.libs=-larm_cortexM0l_math -lm -lstdc++ -teensyLC.serial.restart_cmd=false -teensyLC.menu.usb.serial=Serial -teensyLC.menu.usb.serial.build.usbtype=USB_SERIAL -teensyLC.menu.usb.serial2=Dual Serial -teensyLC.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL -teensyLC.menu.usb.serial3=Triple Serial -teensyLC.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL -teensyLC.menu.usb.keyboard=Keyboard -teensyLC.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY -teensyLC.menu.usb.keyboard.fake_serial=teensy_gateway -teensyLC.menu.usb.hid=Keyboard + Mouse + Joystick -teensyLC.menu.usb.hid.build.usbtype=USB_HID -teensyLC.menu.usb.hid.fake_serial=teensy_gateway -teensyLC.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensyLC.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensyLC.menu.usb.touch=Keyboard + Touch Screen -teensyLC.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN -teensyLC.menu.usb.touch.fake_serial=teensy_gateway -teensyLC.menu.usb.midi=MIDI -teensyLC.menu.usb.midi.build.usbtype=USB_MIDI -teensyLC.menu.usb.midi.fake_serial=teensy_gateway -teensyLC.menu.usb.midi4=MIDIx4 -teensyLC.menu.usb.midi4.build.usbtype=USB_MIDI4 -teensyLC.menu.usb.midi4.fake_serial=teensy_gateway -teensyLC.menu.usb.serialmidi=Serial + MIDI -teensyLC.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL -teensyLC.menu.usb.serialmidi4=Serial + MIDIx4 -teensyLC.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL -teensyLC.menu.usb.mtp=MTP Disk (Experimental) -teensyLC.menu.usb.mtp.build.usbtype=USB_MTPDISK -teensyLC.menu.usb.mtp.fake_serial=teensy_gateway -teensyLC.menu.usb.rawhid=Raw HID -teensyLC.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensyLC.menu.usb.rawhid.fake_serial=teensy_gateway -teensyLC.menu.usb.flightsim=Flight Sim Controls -teensyLC.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensyLC.menu.usb.flightsim.fake_serial=teensy_gateway -teensyLC.menu.usb.disable=No USB -teensyLC.menu.usb.disable.build.usbtype=USB_DISABLED - -teensyLC.menu.speed.48=48 MHz -teensyLC.menu.speed.24=24 MHz -teensyLC.menu.speed.48.build.fcpu=48000000 -teensyLC.menu.speed.24.build.fcpu=24000000 - -teensyLC.menu.opt.osstd=Smallest Code -teensyLC.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs -teensyLC.menu.opt.osstd.build.flags.ldspecs= -teensyLC.menu.opt.oslto=Smallest Code with LTO -teensyLC.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs -teensyLC.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin -teensyLC.menu.opt.ogstd=Debug -teensyLC.menu.opt.ogstd.build.flags.optimize=-Og -teensyLC.menu.opt.ogstd.build.flags.ldspecs= -teensyLC.menu.opt.oglto=Debug with LTO -teensyLC.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects -teensyLC.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin -teensyLC.menu.opt.o3std=Fastest -teensyLC.menu.opt.o3std.build.flags.optimize=-O3 -teensyLC.menu.opt.o3std.build.flags.ldspecs= -teensyLC.menu.opt.o3lto=Fastest with LTO -teensyLC.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects -teensyLC.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin -teensyLC.menu.opt.o2std=Faster -teensyLC.menu.opt.o2std.build.flags.optimize=-O2 -teensyLC.menu.opt.o2std.build.flags.ldspecs= -teensyLC.menu.opt.o2lto=Faster with LTO -teensyLC.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects -teensyLC.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin -teensyLC.menu.opt.o1std=Fast -teensyLC.menu.opt.o1std.build.flags.optimize=-O1 -teensyLC.menu.opt.o1std.build.flags.ldspecs= -teensyLC.menu.opt.o1lto=Fast with LTO -teensyLC.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects -teensyLC.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin - -teensyLC.menu.keys.en-us=US English -teensyLC.menu.keys.en-us.build.keylayout=US_ENGLISH -teensyLC.menu.keys.fr-ca=Canadian French -teensyLC.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensyLC.menu.keys.xx-ca=Canadian Multilingual -teensyLC.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensyLC.menu.keys.cz-cz=Czech -teensyLC.menu.keys.cz-cz.build.keylayout=CZECH -teensyLC.menu.keys.da-da=Danish -teensyLC.menu.keys.da-da.build.keylayout=DANISH -teensyLC.menu.keys.fi-fi=Finnish -teensyLC.menu.keys.fi-fi.build.keylayout=FINNISH -teensyLC.menu.keys.fr-fr=French -teensyLC.menu.keys.fr-fr.build.keylayout=FRENCH -teensyLC.menu.keys.fr-be=French Belgian -teensyLC.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensyLC.menu.keys.fr-ch=French Swiss -teensyLC.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensyLC.menu.keys.de-de=German -teensyLC.menu.keys.de-de.build.keylayout=GERMAN -teensyLC.menu.keys.de-dm=German (Mac) -teensyLC.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensyLC.menu.keys.de-ch=German Swiss -teensyLC.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensyLC.menu.keys.is-is=Icelandic -teensyLC.menu.keys.is-is.build.keylayout=ICELANDIC -teensyLC.menu.keys.en-ie=Irish -teensyLC.menu.keys.en-ie.build.keylayout=IRISH -teensyLC.menu.keys.it-it=Italian -teensyLC.menu.keys.it-it.build.keylayout=ITALIAN -teensyLC.menu.keys.no-no=Norwegian -teensyLC.menu.keys.no-no.build.keylayout=NORWEGIAN -teensyLC.menu.keys.pt-pt=Portuguese -teensyLC.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensyLC.menu.keys.pt-br=Portuguese Brazilian -teensyLC.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensyLC.menu.keys.rs-rs=Serbian (Latin Only) -teensyLC.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensyLC.menu.keys.es-es=Spanish -teensyLC.menu.keys.es-es.build.keylayout=SPANISH -teensyLC.menu.keys.es-mx=Spanish Latin America -teensyLC.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensyLC.menu.keys.sv-se=Swedish -teensyLC.menu.keys.sv-se.build.keylayout=SWEDISH -teensyLC.menu.keys.tr-tr=Turkish (partial) -teensyLC.menu.keys.tr-tr.build.keylayout=TURKISH -teensyLC.menu.keys.en-gb=United Kingdom -teensyLC.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensyLC.menu.keys.usint=US International -teensyLC.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - -teensypp2.name=Teensy++ 2.0 -teensypp2.upload.maximum_size=130048 -teensypp2.upload.maximum_data_size=8192 -teensypp2.upload.tool=teensyloader -teensypp2.upload.protocol=halfkay -teensypp2.build.board=TEENSY2PP -teensypp2.build.core=teensy -teensypp2.build.mcu=at90usb1286 -teensypp2.build.warn_data_percentage=94 -teensypp2.build.toolchain=avr/bin/ -teensypp2.build.command.gcc=avr-gcc -teensypp2.build.command.g++=avr-g++ -teensypp2.build.command.ar=avr-ar -teensypp2.build.command.objcopy=avr-objcopy -teensypp2.build.command.objdump=avr-objdump -teensypp2.build.command.linker=avr-gcc -teensypp2.build.command.size=avr-size -teensypp2.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -teensypp2.build.flags.dep=-MMD -teensypp2.build.flags.optimize=-Os -teensypp2.build.flags.cpu=-mmcu=at90usb1286 -teensypp2.build.flags.defs=-DTEENSYDUINO=153 -DARDUINO_ARCH_AVR -teensypp2.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++11 -teensypp2.build.flags.c= -teensypp2.build.flags.S=-x assembler-with-cpp -teensypp2.build.flags.ld=-Wl,--gc-sections,--relax -teensypp2.build.flags.ldspecs= -teensypp2.build.flags.libs=-lm -teensypp2.build.serial_number=true -teensypp2.serial.restart_cmd=true - -teensypp2.menu.usb.serial=Serial -teensypp2.menu.usb.serial.build.usbtype=USB_SERIAL -teensypp2.menu.usb.hid=Keyboard + Mouse + Joystick -teensypp2.menu.usb.hid.build.usbtype=USB_HID -teensypp2.menu.usb.hid.fake_serial=teensy_gateway -teensypp2.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensypp2.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensypp2.menu.usb.int_disk=Disk(Internal) + Keyboard -teensypp2.menu.usb.int_disk.build.usbtype=USB_DISK -teensypp2.menu.usb.int_disk.fake_serial=teensy_gateway -teensypp2.menu.usb.int_disk.build.elfpatch=mktinyfat -teensypp2.menu.usb.sd_disk=Disk(SD Card) + Keyboard -teensypp2.menu.usb.sd_disk.build.usbtype=USB_DISK_SDFLASH -teensypp2.menu.usb.sd_disk.fake_serial=teensy_gateway -teensypp2.menu.usb.midi=MIDI -teensypp2.menu.usb.midi.build.usbtype=USB_MIDI -teensypp2.menu.usb.midi.fake_serial=teensy_gateway -teensypp2.menu.usb.rawhid=Raw HID -teensypp2.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensypp2.menu.usb.rawhid.fake_serial=teensy_gateway -teensypp2.menu.usb.flightsim=Flight Sim Controls -teensypp2.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensypp2.menu.usb.flightsim.fake_serial=teensy_gateway -teensypp2.menu.speed.16=16 MHz -teensypp2.menu.speed.8=8 MHz -teensypp2.menu.speed.4=4 MHz -teensypp2.menu.speed.2=2 MHz -teensypp2.menu.speed.1=1 MHz -teensypp2.menu.speed.16.build.fcpu=16000000L -teensypp2.menu.speed.8.build.fcpu=8000000L -teensypp2.menu.speed.4.build.fcpu=4000000L -teensypp2.menu.speed.2.build.fcpu=2000000L -teensypp2.menu.speed.1.build.fcpu=1000000L - -teensypp2.menu.keys.en-us=US English -teensypp2.menu.keys.en-us.build.keylayout=US_ENGLISH -teensypp2.menu.keys.fr-ca=Canadian French -teensypp2.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensypp2.menu.keys.xx-ca=Canadian Multilingual -teensypp2.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensypp2.menu.keys.cz-cz=Czech -teensypp2.menu.keys.cz-cz.build.keylayout=CZECH -teensypp2.menu.keys.da-da=Danish -teensypp2.menu.keys.da-da.build.keylayout=DANISH -teensypp2.menu.keys.fi-fi=Finnish -teensypp2.menu.keys.fi-fi.build.keylayout=FINNISH -teensypp2.menu.keys.fr-fr=French -teensypp2.menu.keys.fr-fr.build.keylayout=FRENCH -teensypp2.menu.keys.fr-be=French Belgian -teensypp2.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensypp2.menu.keys.fr-ch=French Swiss -teensypp2.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensypp2.menu.keys.de-de=German -teensypp2.menu.keys.de-de.build.keylayout=GERMAN -teensypp2.menu.keys.de-dm=German (Mac) -teensypp2.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensypp2.menu.keys.de-ch=German Swiss -teensypp2.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensypp2.menu.keys.is-is=Icelandic -teensypp2.menu.keys.is-is.build.keylayout=ICELANDIC -teensypp2.menu.keys.en-ie=Irish -teensypp2.menu.keys.en-ie.build.keylayout=IRISH -teensypp2.menu.keys.it-it=Italian -teensypp2.menu.keys.it-it.build.keylayout=ITALIAN -teensypp2.menu.keys.no-no=Norwegian -teensypp2.menu.keys.no-no.build.keylayout=NORWEGIAN -teensypp2.menu.keys.pt-pt=Portuguese -teensypp2.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensypp2.menu.keys.pt-br=Portuguese Brazilian -teensypp2.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensypp2.menu.keys.rs-rs=Serbian (Latin Only) -teensypp2.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensypp2.menu.keys.es-es=Spanish -teensypp2.menu.keys.es-es.build.keylayout=SPANISH -teensypp2.menu.keys.es-mx=Spanish Latin America -teensypp2.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensypp2.menu.keys.sv-se=Swedish -teensypp2.menu.keys.sv-se.build.keylayout=SWEDISH -teensypp2.menu.keys.tr-tr=Turkish (partial) -teensypp2.menu.keys.tr-tr.build.keylayout=TURKISH -teensypp2.menu.keys.en-gb=United Kingdom -teensypp2.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensypp2.menu.keys.usint=US International -teensypp2.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - -teensy2.name=Teensy 2.0 -teensy2.upload.maximum_size=32256 -teensy2.upload.maximum_data_size=2560 -teensy2.upload.tool=teensyloader -teensy2.upload.protocol=halfkay -teensy2.build.board=TEENSY2 -teensy2.build.core=teensy -teensy2.build.mcu=atmega32u4 -teensy2.build.warn_data_percentage=80 -teensy2.build.toolchain=avr/bin/ -teensy2.build.command.gcc=avr-gcc -teensy2.build.command.g++=avr-g++ -teensy2.build.command.ar=avr-ar -teensy2.build.command.objcopy=avr-objcopy -teensy2.build.command.objdump=avr-objdump -teensy2.build.command.linker=avr-gcc -teensy2.build.command.size=avr-size -teensy2.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -teensy2.build.flags.dep=-MMD -teensy2.build.flags.optimize=-Os -teensy2.build.flags.cpu=-mmcu=atmega32u4 -teensy2.build.flags.defs=-DTEENSYDUINO=153 -DARDUINO_ARCH_AVR -teensy2.build.flags.cpp=-fno-exceptions -fpermissive -felide-constructors -std=gnu++11 -teensy2.build.flags.c= -teensy2.build.flags.S=-x assembler-with-cpp -teensy2.build.flags.ld=-Wl,--gc-sections,--relax -teensy2.build.flags.ldspecs= -teensy2.build.flags.libs=-lm -teensy2.build.serial_number=true -teensy2.serial.restart_cmd=true - -teensy2.menu.usb.serial=Serial -teensy2.menu.usb.serial.build.usbtype=USB_SERIAL -teensy2.menu.usb.hid=Keyboard + Mouse + Joystick -teensy2.menu.usb.hid.build.usbtype=USB_HID -teensy2.menu.usb.hid.fake_serial=teensy_gateway -teensy2.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick -teensy2.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID -teensy2.menu.usb.int_disk=Disk(Internal) + Keyboard -teensy2.menu.usb.int_disk.build.usbtype=USB_DISK -teensy2.menu.usb.int_disk.fake_serial=teensy_gateway -teensy2.menu.usb.int_disk.build.elfpatch=mktinyfat -teensy2.menu.usb.sd_disk=Disk(SD Card) + Keyboard -teensy2.menu.usb.sd_disk.build.usbtype=USB_DISK_SDFLASH -teensy2.menu.usb.sd_disk.fake_serial=teensy_gateway -teensy2.menu.usb.midi=MIDI -teensy2.menu.usb.midi.build.usbtype=USB_MIDI -teensy2.menu.usb.midi.fake_serial=teensy_gateway -teensy2.menu.usb.rawhid=Raw HID -teensy2.menu.usb.rawhid.build.usbtype=USB_RAWHID -teensy2.menu.usb.rawhid.fake_serial=teensy_gateway -teensy2.menu.usb.flightsim=Flight Sim Controls -teensy2.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM -teensy2.menu.usb.flightsim.fake_serial=teensy_gateway -teensy2.menu.speed.16=16 MHz -teensy2.menu.speed.8=8 MHz -teensy2.menu.speed.4=4 MHz -teensy2.menu.speed.2=2 MHz -teensy2.menu.speed.1=1 MHz -teensy2.menu.speed.16.build.fcpu=16000000L -teensy2.menu.speed.8.build.fcpu=8000000L -teensy2.menu.speed.4.build.fcpu=4000000L -teensy2.menu.speed.2.build.fcpu=2000000L -teensy2.menu.speed.1.build.fcpu=1000000L - -teensy2.menu.keys.en-us=US English -teensy2.menu.keys.en-us.build.keylayout=US_ENGLISH -teensy2.menu.keys.fr-ca=Canadian French -teensy2.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH -teensy2.menu.keys.xx-ca=Canadian Multilingual -teensy2.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL -teensy2.menu.keys.cz-cz=Czech -teensy2.menu.keys.cz-cz.build.keylayout=CZECH -teensy2.menu.keys.da-da=Danish -teensy2.menu.keys.da-da.build.keylayout=DANISH -teensy2.menu.keys.fi-fi=Finnish -teensy2.menu.keys.fi-fi.build.keylayout=FINNISH -teensy2.menu.keys.fr-fr=French -teensy2.menu.keys.fr-fr.build.keylayout=FRENCH -teensy2.menu.keys.fr-be=French Belgian -teensy2.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN -teensy2.menu.keys.fr-ch=French Swiss -teensy2.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS -teensy2.menu.keys.de-de=German -teensy2.menu.keys.de-de.build.keylayout=GERMAN -teensy2.menu.keys.de-dm=German (Mac) -teensy2.menu.keys.de-dm.build.keylayout=GERMAN_MAC -teensy2.menu.keys.de-ch=German Swiss -teensy2.menu.keys.de-ch.build.keylayout=GERMAN_SWISS -teensy2.menu.keys.is-is=Icelandic -teensy2.menu.keys.is-is.build.keylayout=ICELANDIC -teensy2.menu.keys.en-ie=Irish -teensy2.menu.keys.en-ie.build.keylayout=IRISH -teensy2.menu.keys.it-it=Italian -teensy2.menu.keys.it-it.build.keylayout=ITALIAN -teensy2.menu.keys.no-no=Norwegian -teensy2.menu.keys.no-no.build.keylayout=NORWEGIAN -teensy2.menu.keys.pt-pt=Portuguese -teensy2.menu.keys.pt-pt.build.keylayout=PORTUGUESE -teensy2.menu.keys.pt-br=Portuguese Brazilian -teensy2.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN -teensy2.menu.keys.rs-rs=Serbian (Latin Only) -teensy2.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY -teensy2.menu.keys.es-es=Spanish -teensy2.menu.keys.es-es.build.keylayout=SPANISH -teensy2.menu.keys.es-mx=Spanish Latin America -teensy2.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA -teensy2.menu.keys.sv-se=Swedish -teensy2.menu.keys.sv-se.build.keylayout=SWEDISH -teensy2.menu.keys.tr-tr=Turkish (partial) -teensy2.menu.keys.tr-tr.build.keylayout=TURKISH -teensy2.menu.keys.en-gb=United Kingdom -teensy2.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM -teensy2.menu.keys.usint=US International -teensy2.menu.keys.usint.build.keylayout=US_INTERNATIONAL - - diff --git a/third-party/TeensyTimerTool/library.json b/third-party/TeensyTimerTool/library.json deleted file mode 100644 index 5fc6f3a..0000000 --- a/third-party/TeensyTimerTool/library.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "TeensyTimerTool", - "keywords": "teensy, pjrc, timer, quad, gpt, tmr, pit, imxrt1062", - "description": "TeensyTimerTool is a library that provides a generic, easy to use interface to the hardware timers of the PJRC Teensy boards. In addition, it provides up to 20 highly efficient software timers that use the same interface. All timers can be used in periodic and one-shot mode. Currently the library supports the ARM T3.X and T4.0 boards. You can either pick a free timer from a pool or specify exactly which of the available hardware or software timer modules you want to use.", - "repository": - { - "type": "git", - "url": "https://github.com/luni64/TeensyTimerTool" - }, - "authors": - { - "name": "luni64", - "url": "https://github.com/luni64", - "maintainer": true - }, - "homepage": "https://github.com/luni64/TeensyTimerTool", - "version": "1.0.0", - "frameworks": "arduino", - "platforms": "Teensy" -} diff --git a/third-party/TeensyTimerTool/library.properties b/third-party/TeensyTimerTool/library.properties deleted file mode 100644 index 1931bb0..0000000 --- a/third-party/TeensyTimerTool/library.properties +++ /dev/null @@ -1,10 +0,0 @@ -name=TeensyTimerTool -version=1.0.0 -author=luni64 -maintainer=luni64 -sentence=Generic Interface to Teensy Timers -paragraph= TeensyTimerTool is a library that provides a generic, easy to use interface to the hardware timers (FTM, GPT, QUAD, PIT) of the PJRC Teensy boards. In addition, it provides up to 20 highly efficient software timers based on the cycle counter or the RTC (32 and 64bit) that use the same interface. All timers can be used in periodic and one-shot mode. Currently the library supports the ARM T3.X and T4.0 boards. You can either pick a free timer from a pool or specify exactly which of the available hardware or software timer modules you want to use. -category=Timing -url=https://github.com/luni64/TeensyTimerTool -architectures=* -includes=TeensyTimerTool.h diff --git a/third-party/TeensyTimerTool/src/API/Timer.cpp b/third-party/TeensyTimerTool/src/API/Timer.cpp deleted file mode 100644 index f15b7ea..0000000 --- a/third-party/TeensyTimerTool/src/API/Timer.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "timer.h" -#include "config.h" - -namespace TeensyTimerTool -{ - Timer::Timer(TimerGenerator *generator) - : BaseTimer(generator, true) - { - } -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/API/baseTimer.cpp b/third-party/TeensyTimerTool/src/API/baseTimer.cpp deleted file mode 100644 index 2652c39..0000000 --- a/third-party/TeensyTimerTool/src/API/baseTimer.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "baseTimer.h" -//#include "Arduino.h" -#include "types.h" - -namespace TeensyTimerTool -{ - - BaseTimer::BaseTimer(TimerGenerator *generator, bool periodic) - : timerGenerator(generator) - { - this->timerGenerator = generator; - this->timerChannel = nullptr; - this->isPeriodic = periodic; - } - - BaseTimer::~BaseTimer() - { - if (timerChannel != nullptr) - { - delete timerChannel; - } - } - - errorCode BaseTimer::setPrescaler(int psc) - { - this->prescaler = psc; - return errorCode::OK; - } - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/API/baseTimer.h b/third-party/TeensyTimerTool/src/API/baseTimer.h deleted file mode 100644 index 45b8eaa..0000000 --- a/third-party/TeensyTimerTool/src/API/baseTimer.h +++ /dev/null @@ -1,115 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "ErrorHandling/error_codes.h" -#include "ITimerChannel.h" -#include "helpers.h" -#include - -#if defined(USE_TIME_LITERALS) -//#include "frequency.h" -#include -#include -using namespace std::chrono_literals; -using namespace std::chrono; -#endif - -namespace TeensyTimerTool -{ - class BaseTimer - { - public: - template - inline errorCode begin(callback_t callback, period_t period, bool start = true); - inline errorCode setPrescaler(int psc); - inline errorCode end(); - inline errorCode start(); - inline errorCode stop(); - - inline float getMaxPeriod() const; - inline float getRemainingTime() const; - - protected: - BaseTimer(TimerGenerator *generator, bool periodic); - virtual ~BaseTimer(); - - TimerGenerator *timerGenerator; - ITimerChannel *timerChannel; - bool isPeriodic; - uint32_t prescaler = 0; - }; - - // INLINE IMPLEMENTATION ================================================ - - template - errorCode BaseTimer::begin(callback_t callback, period_t p, bool start) - { - float period = period2us(p); // transform from any period type to microseconds (float) - - if (callback == nullptr) return postError(errorCode::callback); - if (isPeriodic && period == 0) return postError(errorCode::reload); - - if (timerChannel == nullptr) - { - if (timerGenerator != nullptr) // use timer passed in during construction - { - timerChannel = timerGenerator(); - if (timerChannel == nullptr) return postError(errorCode::noFreeChannel); - } else //find the next free timer - { - for (unsigned i = 0; timerChannel == nullptr && i < timerCnt; i++) - { - timerChannel = timerPool[i](); - } - } - if (timerChannel == nullptr) return postError(errorCode::noFreeModule); - } - - errorCode result = timerChannel->begin(callback, period, isPeriodic); - - if (result == errorCode::OK) - { - if (isPeriodic && start) timerChannel->start(); - } - return postError(result); - } - - errorCode BaseTimer::end() - { - return postError(errorCode::notImplemented); - } - - errorCode BaseTimer::start() - { - if (timerChannel) - return postError(timerChannel->start()); - - return postError(errorCode::notInitialized); - } - - errorCode BaseTimer::stop() - { - if (timerChannel) - return postError(timerChannel->stop()); - - return postError(errorCode::notInitialized); - } - - float BaseTimer::getMaxPeriod() const - { - if (timerChannel != nullptr) - return timerChannel->getMaxPeriod(); - - postError(errorCode::notInitialized); - return NAN; - } - - float BaseTimer::getRemainingTime() const - { - if (timerChannel != nullptr) - return timerChannel->getRemainingTime(); - - postError(errorCode::notInitialized); - return NAN; - } -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/API/oneShotTimer.h b/third-party/TeensyTimerTool/src/API/oneShotTimer.h deleted file mode 100644 index 367c215..0000000 --- a/third-party/TeensyTimerTool/src/API/oneShotTimer.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include "ErrorHandling/error_codes.h" -#include "baseTimer.h" -#include "type_traits" - -namespace TeensyTimerTool -{ - class OneShotTimer : public BaseTimer - { - public: - inline OneShotTimer(TimerGenerator *generator = nullptr); - - inline errorCode begin(callback_t cb); - template errorCode trigger(T delay); - template errorCode triggerDirect(T reload); - template errorCode getTriggerReload(float delay, T *reload); - }; - - // Implementation ================================================ - - OneShotTimer::OneShotTimer(TimerGenerator *generator) - : BaseTimer(generator, false) - {} - - errorCode OneShotTimer::begin(callback_t callback) - { - return BaseTimer::begin(callback, 0, false); - } - - template - errorCode OneShotTimer::trigger(period_t delay) - { - if (timerChannel) - return postError(timerChannel->trigger(period2us(delay))); - - return postError(errorCode::notInitialized); - } - - template - errorCode OneShotTimer::triggerDirect(T reload) - { - if (timerChannel) - return postError(timerChannel->triggerDirect(reload)); - - return postError(errorCode::notInitialized); - } - - template - errorCode OneShotTimer::getTriggerReload(float delay, T *reload) - { - if (timerChannel) - return postError(timerChannel->getTriggerReload(delay, reload)); - - return postError(errorCode::notInitialized); - } -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/API/periodicTimer.h b/third-party/TeensyTimerTool/src/API/periodicTimer.h deleted file mode 100644 index 921e020..0000000 --- a/third-party/TeensyTimerTool/src/API/periodicTimer.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "baseTimer.h" - -namespace TeensyTimerTool -{ - class PeriodicTimer : public BaseTimer - { - public: - PeriodicTimer(TimerGenerator *generator = nullptr) : BaseTimer(generator, true) {} - - template - inline errorCode setPeriod(period_t p) { return postError(timerChannel->setPeriod(period2us(p))); }; - - template - inline errorCode setNextPeriod(period_t p) { return postError(timerChannel->setNextPeriod(period2us(p))); }; - }; - - // IMPLEMENTATION ===================================================================== - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/API/timer.h b/third-party/TeensyTimerTool/src/API/timer.h deleted file mode 100644 index 7cf3954..0000000 --- a/third-party/TeensyTimerTool/src/API/timer.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once -#include "ErrorHandling/error_codes.h" -#include "ITimerChannel.h" -#include "baseTimer.h" -#include "types.h" - -namespace TeensyTimerTool -{ - class [[deprecated("Consider using PeriodicTimer or OneShotTimer instead")]] Timer : public BaseTimer - { - public: - Timer(TimerGenerator *gen = nullptr); - - inline errorCode beginPeriodic(callback_t cb, uint32_t period) - { - isPeriodic = true; - return BaseTimer::begin(cb, period, true); - } - inline errorCode beginOneShot(callback_t cb) - { - isPeriodic = false; - return BaseTimer::begin(cb, 0, false); - } - inline void trigger(uint32_t delay); - }; - - // IMPLEMENTATION ======================================================= - - void Timer::trigger(const uint32_t delay) - { - timerChannel->trigger(delay); - } -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/ErrorHandling/error_codes.h b/third-party/TeensyTimerTool/src/ErrorHandling/error_codes.h deleted file mode 100644 index a4c8aac..0000000 --- a/third-party/TeensyTimerTool/src/ErrorHandling/error_codes.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -namespace TeensyTimerTool -{ - enum class errorCode { - OK = 0, - - // Warnings - periodOverflow = -100, - wrongType = -101, - triggeredLate = -102, //warn if new setted period is shorter than elapsed time - - //General errors - argument = 100, - callback = 101, - reload = 102, - noFreeModule = 103, - noFreeChannel = 104, // requested module has no free channel - notImplemented = 105, // timer does not support this feature - notInitialized = 106, - - // GTP Errors - GTP_err = 200, - GTP_err2 = 201, - - //TMR Errors - TMR_err = 300, - TMR_err2 = 301, - - //FTM Errors - FTM_err = 400, - FTM_err2 = 401, - - //TCK Errors - TCK_err = 900, - TCK_err2 = 901, - }; -} \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/ErrorHandling/error_handler.cpp b/third-party/TeensyTimerTool/src/ErrorHandling/error_handler.cpp deleted file mode 100644 index 125ace2..0000000 --- a/third-party/TeensyTimerTool/src/ErrorHandling/error_handler.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include "error_handler.h" -#include "core_pins.h" -#include "types.h" - -namespace TeensyTimerTool -{ - ErrorHandler::ErrorHandler(Stream &s) : stream(s) - { - pinMode(LED_BUILTIN, OUTPUT); - } - - void ErrorHandler::operator()(errorCode code) const - { - const char *txt; - - switch (code) - { - case errorCode::OK: - txt = "OK"; - break; - - // warnings - case errorCode::periodOverflow: - txt = "Period overflow. Period was set to maximum value"; - break; - case errorCode::wrongType: - txt = "Wrong parameter type"; - break; - - // general errors - case errorCode::reload: - txt = "Period must not be zero"; - break; - case errorCode::noFreeChannel: - txt = "Timer module has no free channel"; - break; - case errorCode::noFreeModule: - txt = "Timer pool contains no free timer"; - break; - case errorCode::notImplemented: - txt = "Function not implemented for this timer"; - break; - case errorCode::notInitialized: - txt = "Timer not initialized or available. Did you call begin?"; - break; - - default: - txt = "Unknown error"; - break; - } - - if ((int)code < 0) // in case of warnings we return after printing - { - stream.printf("W-%i: %s\n", -(int)code, txt); - return; - } - - stream.printf("E-%i: %s\n", (int)code, txt); // in case of errors we don't return - while (true) - { - digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN)); - delay(50); - } - } - - errorFunc_t errFunc; - - errorCode postError(errorCode e) - { - if (errFunc != nullptr && e != errorCode::OK) errFunc(e); - return e; - } - - void attachErrFunc(errorFunc_t _errFunc) - { - errFunc = _errFunc; - } - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/ErrorHandling/error_handler.h b/third-party/TeensyTimerTool/src/ErrorHandling/error_handler.h deleted file mode 100644 index aac06e3..0000000 --- a/third-party/TeensyTimerTool/src/ErrorHandling/error_handler.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "Stream.h" -#include "error_codes.h" - -namespace TeensyTimerTool -{ - class ErrorHandler - { - public: - ErrorHandler(Stream &s); - void operator()(errorCode code) const; - - protected: - Stream &stream; - }; -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/ITimerChannel.h b/third-party/TeensyTimerTool/src/ITimerChannel.h deleted file mode 100644 index 95ac616..0000000 --- a/third-party/TeensyTimerTool/src/ITimerChannel.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "types.h" -#include - -namespace TeensyTimerTool -{ - class ITimerChannel - { - public: - virtual errorCode begin(callback_t callback, float period, bool oneShot) = 0; - virtual errorCode trigger(float delay) = 0; - virtual errorCode triggerDirect(uint32_t reload) { return postError(errorCode::notImplemented); }; - virtual errorCode triggerDirect(uint64_t reload) { return postError(errorCode::notImplemented); }; - virtual errorCode getTriggerReload(float delay, uint32_t *reload) { return postError(errorCode::notImplemented); }; - virtual errorCode getTriggerReload(float delay, uint64_t *reload) { return postError(errorCode::notImplemented); }; - - virtual errorCode start() = 0; - virtual errorCode stop() = 0; - - virtual errorCode setPrescaler(int psc) { return postError(errorCode::notImplemented); } - - virtual float getMaxPeriod() const = 0; - virtual float getRemainingTime() const { postError(errorCode::notImplemented); return NAN; } - virtual errorCode setPeriod(float microSeconds) { return postError(errorCode::notImplemented); }; - virtual errorCode setNextPeriod(float microSeconds) { return postError(errorCode::notImplemented); }; - virtual uint32_t getPeriod() { return 0; } - - inline void setCallback(callback_t); - - virtual ~ITimerChannel(){}; - - protected: - inline ITimerChannel(callback_t *cbStorage = nullptr); - callback_t *pCallback; - }; - - // IMPLEMENTATION ==================================================== - - ITimerChannel::ITimerChannel(callback_t *cbStorage) - { - this->pCallback = cbStorage; - } - - void ITimerChannel::setCallback(callback_t cb) - { - *pCallback = cb; - } - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TeensyTimerTool.h b/third-party/TeensyTimerTool/src/TeensyTimerTool.h deleted file mode 100644 index d917c64..0000000 --- a/third-party/TeensyTimerTool/src/TeensyTimerTool.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "API/oneShotTimer.h" -#include "API/periodicTimer.h" -#include "API/timer.h" -#include "ErrorHandling/error_handler.h" -#include "config.h" - -static_assert(TEENSYDUINO >= 150, "This library requires Teensyduino > 1.5"); \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM.h b/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM.h deleted file mode 100644 index 0d6b07d..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM.h +++ /dev/null @@ -1,95 +0,0 @@ -#pragma once -#include "FTM_Channel.h" -#include "FTM_Info.h" - -namespace TeensyTimerTool -{ - template - class FTM_t - { - public: - inline static ITimerChannel *getTimer(); - FTM_t() = delete; - - private: - static bool isInitialized; - inline static void isr() FASTRUN; - - static constexpr unsigned maxChannel = FTM_Info::nrOfChannels; - static FTM_ChannelInfo channelInfo[maxChannel]; - static FTM_r_t * const r; - - static_assert(moduleNr < 4, "Module number < 4 required"); - }; - - // IMPLEMENTATION ================================================================== - - template - ITimerChannel *FTM_t::getTimer() - { - if (!isInitialized) - { - r->SC = FTM_SC_CLKS(0b00); // Disable clock - r->MOD = 0xFFFF; // Set full counter range - r->CNT = 0; - - for (unsigned chNr = 0; chNr < maxChannel; chNr++) // init channels - { - channelInfo[chNr].isReserved = false; - channelInfo[chNr].callback = nullptr; - channelInfo[chNr].chRegs = &r->CH[chNr]; - channelInfo[chNr].ticksPerMicrosecond = 1E-6f * F_BUS / (1 << FTM_Info::prescale); - - r->CH[chNr].SC &= ~FTM_CSC_CHF; // FTM requires to clear flag by setting bit to 0 - r->CH[chNr].SC &= ~FTM_CSC_CHIE; // Disable channel interupt - r->CH[chNr].SC = FTM_CSC_MSA; - } - r->SC = FTM_SC_CLKS(0b01) | FTM_SC_PS(FTM_Info::prescale); // Start clock - attachInterruptVector(FTM_Info::irqNumber, isr); // prepare isr and nvic, don't yet enable interrupts - NVIC_ENABLE_IRQ(FTM_Info::irqNumber); - isInitialized = true; - } - - for (unsigned chNr = 0; chNr < maxChannel; chNr++) - { - if (!channelInfo[chNr].isReserved) - { - channelInfo[chNr].isReserved = true; - return new FTM_Channel(r, &channelInfo[chNr]); - } - } - return nullptr; - } - - template - void FTM_t::isr() - { - for (unsigned i = 0; i < maxChannel; i++) - { - FTM_ChannelInfo *ci = &channelInfo[i]; // pre resolving the references turns out to be slightly faster - FTM_CH_t *cr = ci->chRegs; - if ((cr->SC & (FTM_CSC_CHIE | FTM_CSC_CHF)) == (FTM_CSC_CHIE | FTM_CSC_CHF)) // only handle if channel is active (CHIE set) and overflowed (CHF set) - { - if (ci->isPeriodic) - { - cr->SC &= ~FTM_CSC_CHF; // clear channel flag - cr->CV = r->CNT + ci->reload; // set compare value to 'reload' counts ahead of counter - } else - { - cr->SC &= ~FTM_CSC_CHIE; //disable interrupt in on shot mode - } - ci->callback(); - } - } - } - - template - FTM_ChannelInfo FTM_t::channelInfo[maxChannel]; - - template - bool FTM_t::isInitialized = false; - - template - FTM_r_t* const FTM_t::r = (FTM_r_t *)FTM_Info::baseAdr; -} // namespace TeensyTimerTool - diff --git a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_Channel.h b/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_Channel.h deleted file mode 100644 index 68ed25a..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_Channel.h +++ /dev/null @@ -1,121 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "FTM_ChannelInfo.h" -#include "FTM_Info.h" -#include "ITimerChannel.h" - -namespace TeensyTimerTool -{ - class FTM_Channel : public ITimerChannel - { - public: - inline FTM_Channel(FTM_r_t *regs, FTM_ChannelInfo *ci); - inline virtual ~FTM_Channel(); - - inline float getMaxPeriod() const override; - - inline errorCode begin(callback_t cb, float period, bool periodic) { return doBegin(cb, period, periodic); } ///hacky improve in later version - inline errorCode begin(callback_t cb, uint32_t period, bool periodic) { return doBegin(cb, period, periodic); }; - - inline errorCode trigger(float tcnt) override FASTRUN; - inline errorCode triggerDirect(uint32_t reload) override FASTRUN; - inline errorCode getTriggerReload(float delay, uint32_t *reload) override; - - inline errorCode start() override; - inline errorCode stop() override; - - inline uint16_t ticksFromMicros(float micros); - - // inline void setPeriod(uint32_t) {} - - protected: - FTM_ChannelInfo *ci; - FTM_r_t *regs; - callback_t *pCallback = nullptr; - - template - inline errorCode doBegin(callback_t cb, period_t period, bool periodic); - }; - - // IMPLEMENTATION ============================================== - - FTM_Channel::FTM_Channel(FTM_r_t *regs, FTM_ChannelInfo *channelInfo) - : ITimerChannel(nullptr) - { - this->regs = regs; - this->ci = channelInfo; - } - - template - errorCode FTM_Channel::doBegin(callback_t callback, period_t period, bool periodic) - { - ci->isPeriodic = periodic; - ci->reload = ticksFromMicros(period); - ci->callback = callback; - - return errorCode::OK; - } - - errorCode FTM_Channel::start() - { - ci->chRegs->CV = regs->CNT + ci->reload; // compare value (current counter + pReload) - ci->chRegs->SC &= ~FTM_CSC_CHF; // reset timer flag - ci->chRegs->SC = FTM_CSC_MSA | FTM_CSC_CHIE; // enable interrupts - return errorCode::OK; - } - - errorCode FTM_Channel::stop() - { - ci->chRegs->SC &= ~FTM_CSC_CHIE; // enable interrupts - ci->chRegs->SC &= ~FTM_CSC_CHF; // reset timer flag - - return errorCode::OK; - } - - errorCode FTM_Channel::getTriggerReload(float delay, uint32_t *reload) - { - *reload = ticksFromMicros(delay); - return errorCode::OK; - } - - errorCode FTM_Channel::trigger(float delay) - { - return triggerDirect(ticksFromMicros(delay)); - } - - errorCode FTM_Channel::triggerDirect(uint32_t reload) - { - uint32_t cv = regs->CNT + reload + 1; // calc early to minimize error - ci->chRegs->SC &= ~FTM_CSC_CHF; // Reset timer flag - // - regs->SC &= ~FTM_SC_CLKS_MASK; // need to switch off clock to immediately set new CV - ci->chRegs->CV = cv; // compare value (current counter + pReload) - regs->SC |= FTM_SC_CLKS(0b01); // restart clock - // - ci->chRegs->SC = FTM_CSC_MSA | FTM_CSC_CHIE; // enable interrupts - - return errorCode::OK; - } - - float FTM_Channel::getMaxPeriod() const - { - return (0xFFFF * 1E-6f) / ci->ticksPerMicrosecond; // max period in seconds - } - - uint16_t FTM_Channel::ticksFromMicros(float micros) - { - uint32_t rl = ci->ticksPerMicrosecond * micros; - if (rl > 0xFFFF) - { - postError(errorCode::periodOverflow); // warning only, continues with clipped value - rl = 0xFFFF; - } - return rl; - } - - FTM_Channel::~FTM_Channel() - { - } - -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_ChannelInfo.h b/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_ChannelInfo.h deleted file mode 100644 index 052cb96..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_ChannelInfo.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "FTM_Info.h" -#include "types.h" - -namespace TeensyTimerTool -{ - struct FTM_ChannelInfo - { - bool isReserved; - bool isPeriodic; - callback_t callback; - uint32_t reload; - FTM_CH_t *chRegs; - float ticksPerMicrosecond; - }; -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_Info.h b/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_Info.h deleted file mode 100644 index a4beb2c..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/FTM/FTM_Info.h +++ /dev/null @@ -1,109 +0,0 @@ -#pragma once - -#include "boardDef.h" -#include - -// All information in this header is calculated at compile time. -// FTM_Info will not generate any code - -namespace TeensyTimerTool -{ - typedef struct // FTM & TPM Channels - { - volatile uint32_t SC; - volatile uint32_t CV; - } FTM_CH_t; - - typedef struct // FTM register block (this layout is compatible to a TPM register block) - { - volatile uint32_t SC; - volatile uint32_t CNT; - volatile uint32_t MOD; - FTM_CH_t CH[8]; - volatile uint32_t CNTIN; - volatile uint32_t STATUS; - volatile uint32_t MODE; - volatile uint32_t SYNC; - volatile uint32_t OUTINIT; - volatile uint32_t OUTMASK; - volatile uint32_t COMBINE; - volatile uint32_t DEADTIME; - volatile uint32_t EXTTRIG; - volatile uint32_t POL; - volatile uint32_t FMS; - volatile uint32_t FILTER; - volatile uint32_t FLTCTRL; - volatile uint32_t QDCTRL; - volatile uint32_t CONF; - volatile uint32_t FLTPOL; - volatile uint32_t SYNCONF; - volatile uint32_t INVCTRL; - volatile uint32_t SWOCTRL; - volatile uint32_t PWMLOAD; - } FTM_r_t; - - //======================================================================= - // using a static class instead of namespace here to reduce namespace pollution - // (anonymous namespace doesn't make sense for header only class) - - template - class FTM_Info - { - private: -#if defined(ARDUINO_TEENSYLC) - static constexpr unsigned boardNr = 0; -#elif defined(ARDUINO_TEENSY30) - static constexpr unsigned boardNr = 1; -#elif defined(ARDUINO_TEENSY31) || defined(ARDUINO_TEENSY32) - static constexpr unsigned boardNr = 2; -#elif defined(ARDUINO_TEENSY35) - static constexpr unsigned boardNr = 3; -#elif defined(ARDUINO_TEENSY36) - static constexpr unsigned boardNr = 4; -#else -#error Board not valid -#endif - - static constexpr int IRQ_Numbers[][4]{ - //FTM0 FTM1 FTM2 FTM3 - {0, 0, 0, 0}, // Teensy LC - {25, 26, 0, 0}, // Teensy 3.0 - {62, 63, 64, 0}, // Teensy 3.1/3.2 - {42, 43, 44, 71}, // Teensy 3.5 - {42, 43, 44, 71}, // Teensy 3.6 - }; - - static constexpr int FTM_NrOfChannels[]{ - 8, // FTM0 - 2, // FTM1 - 2, // FTM2 - 8, // FTM3 - }; - - static constexpr uintptr_t FTM_BaseAdr[] // can't use defines from kinetis.h since, depending on board, not all are always defined. - { - 0x4003'8000, // FTM0 - 0x4003'9000, // FTM1 - 0x400B'8000, // FTM2 - 0x400B'9000, // FTM3 - }; - - static constexpr unsigned FTM_Prescale = - FTM_DEFAULT_PSC[module] < 0 || FTM_DEFAULT_PSC[module] > 7 ? // prescale value to roughly get 2 ticks per µs - ( - F_BUS > 120'000'000 ? 0b111 : F_BUS > 60'000'000 ? 0b110 - : F_BUS > 30'000'000 ? 0b101 - : F_BUS > 15'000'000 ? 0b100 - : F_BUS > 8'000'000 ? 0b011 - : F_BUS > 4'000'000 ? 0b010 - : F_BUS > 2'000'000 ? 0b001 - : 0b000) - : FTM_DEFAULT_PSC[module]; - - public: - static constexpr uintptr_t baseAdr = FTM_BaseAdr[module]; - static constexpr IRQ_NUMBER_t irqNumber = (IRQ_NUMBER_t)IRQ_Numbers[boardNr][module]; - static constexpr unsigned nrOfChannels = FTM_NrOfChannels[module]; - static constexpr unsigned prescale = FTM_Prescale; - }; -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPT.h b/third-party/TeensyTimerTool/src/TimerModules/GPT/GPT.h deleted file mode 100644 index 1377536..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPT.h +++ /dev/null @@ -1,89 +0,0 @@ -#pragma once - -#include "GPTChannel.h" -//#include "Arduino.h" - -namespace TeensyTimerTool -{ - template - class GPT_t - { - public: - static ITimerChannel *getTimer(); - static void end(); - - protected: - static bool isInitialized; - static void isr(); - static callback_t callback; - static GptChannel *channel; - - // the following is calculated at compile time - static constexpr IRQ_NUMBER_t irq = moduleNr == 0 ? IRQ_GPT1 : IRQ_GPT2; - static IMXRT_GPT_t *const pGPT; - static_assert(moduleNr < 2, "Wrong GPT Number"); - }; - - // IMPLEMENTATION =========================================================================== - - template - IMXRT_GPT_t *const GPT_t::pGPT = reinterpret_cast(moduleNr == 0 ? &IMXRT_GPT1 : &IMXRT_GPT2); - - template - ITimerChannel *GPT_t::getTimer() - { - if (!isInitialized) - { - isInitialized = true; - - if (moduleNr == 0) // GPT1 clock settings - CCM_CCGR1 |= CCM_CCGR1_GPT1_BUS(CCM_CCGR_ON) | CCM_CCGR1_GPT1_SERIAL(CCM_CCGR_ON); // - else // GPT2 - CCM_CCGR0 |= CCM_CCGR0_GPT2_BUS(CCM_CCGR_ON) | CCM_CCGR0_GPT2_SERIAL(CCM_CCGR_ON); // - // - if (USE_GPT_PIT_150MHz) // timer clock setting from config.h - CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // use F_BUS - else // - CCM_CSCMR1 |= CCM_CSCMR1_PERCLK_CLK_SEL; // use 24MHz - // - pGPT->CR = GPT_CR_CLKSRC(0x001) | GPT_CR_ENMOD; // stopped, restart mode and peripheral clock source - - attachInterruptVector(irq, isr); - NVIC_ENABLE_IRQ(irq); - - channel = new GptChannel(pGPT, &callback); - return channel; - } - return nullptr; - } - - template - void GPT_t::isr() - { - if (!channel->periodic) - pGPT->CR &= ~GPT_CR_EN; // stop timer in one shot mode - // - pGPT->SR = 0x3F; // reset all interrupt flags - callback(); // we only enabled the OF1 interrupt-> no need to find out which interrupt was actually called - asm volatile("dsb"); // wait until register changes propagated through the cache - } - - template - void GPT_t::end() - { - //Serial.printf("end %d\n", tmoduleNr); - NVIC_DISABLE_IRQ(irq); - pGPT->CR = 0; - callback = nullptr; - isInitialized = false; - } - - template - bool GPT_t::isInitialized = false; - - template - callback_t GPT_t::callback = nullptr; - - template - GptChannel *GPT_t::channel = nullptr; -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTChannel.cpp b/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTChannel.cpp deleted file mode 100644 index e01ed69..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTChannel.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) || defined(ARDUINO_TEENSY_MICROMOD) - -#include "GPTChannel.h" -#include "GPT.h" -//#include "Arduino.h" - -namespace TeensyTimerTool -{ - GptChannel::~GptChannel() - { - stop(); - setCallback(nullptr); - - if (regs == (IMXRT_GPT_t *)&IMXRT_GPT1) - GPT_t<0>::end(); - - else if (regs == (IMXRT_GPT_t *)&IMXRT_GPT2) - GPT_t<1>::end(); - else - postError(errorCode::GTP_err); - } -} // namespace TeensyTimerTool - -#endif \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTChannel.h b/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTChannel.h deleted file mode 100644 index 3ca482b..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTChannel.h +++ /dev/null @@ -1,129 +0,0 @@ -#pragma once -#include "Arduino.h" -#include "GPTmap.h" -#include "ITimerChannel.h" -#include "core_pins.h" - -namespace TeensyTimerTool -{ - class GptChannel : public ITimerChannel - { - public: - inline GptChannel(IMXRT_GPT_t *, callback_t *); - virtual ~GptChannel(); - - inline errorCode begin(callback_t cb, float tcnt, bool periodic) override; - inline errorCode start() override; - inline errorCode stop() override; - - inline errorCode trigger(float delay) override; - inline errorCode triggerDirect(uint32_t delay) override; - inline errorCode getTriggerReload(float delay, uint32_t *reload) override; - - inline errorCode setNextPeriod(float us) override; - inline errorCode setPeriod(float us) override; - - inline float getMaxPeriod() const override { return getMaxMicros() / 1E6; } - - bool periodic; - - protected: - inline uint32_t us2ticks(float micros) const; - inline float getMaxMicros() const; - - IMXRT_GPT_t *regs; - //uint32_t reload; - float clock; - }; - - // IMPLEMENTATION ============================================== - - GptChannel::GptChannel(IMXRT_GPT_t *registers, callback_t *cbStorage) - : ITimerChannel(cbStorage), regs(registers) - { - clock = (CCM_CSCMR1 & CCM_CSCMR1_PERCLK_CLK_SEL) ? 24 : (F_BUS_ACTUAL / 1000000); - } - - errorCode GptChannel::begin(callback_t cb, float period, bool periodic) - { - this->periodic = periodic; - if (periodic) - { - regs->OCR1 = us2ticks(period); - } - setCallback(cb); - - return errorCode::OK; - } - - errorCode GptChannel::start() - { - regs->SR = 0x3F; // clear all interupt flags - regs->IR = GPT_IR_OF1IE; // enable OF1 interrupt - regs->CR |= GPT_CR_EN; // enable timer - return errorCode::OK; - } - - errorCode GptChannel::stop() - { - regs->CR &= ~GPT_CR_EN; // disable timer - regs->IR = 0; - return errorCode::OK; - } - - errorCode GptChannel::trigger(float delay) //should be optimized somehow - { - return triggerDirect(us2ticks(delay)); - } - - errorCode GptChannel::triggerDirect(uint32_t reload) - { - regs->SR = 0x3F; // clear all interupt flags - regs->IR = GPT_IR_OF1IE; // enable OF1 interrupt - regs->OCR1 = reload; // set overflow value - regs->CR |= GPT_CR_EN; // enable timer - - return errorCode::OK; - } - - errorCode GptChannel::getTriggerReload(float delay, uint32_t *reload) - { - *reload = us2ticks(delay); - return errorCode::OK; - } - - uint32_t GptChannel::us2ticks(float micros) const - { - if (micros > getMaxMicros()) - { - micros = getMaxPeriod(); - postError(errorCode::periodOverflow); - } - return (uint32_t)(clock * micros) - 1; - } - - float GptChannel::getMaxMicros() const - { - return (float)0xFFFF'FFFE / clock; - } - - errorCode GptChannel::setNextPeriod(float us) - { - return errorCode::notImplemented; - } - - errorCode GptChannel::setPeriod(float us) // not good, will generate one too long period if called before cnt == oldPeriod - { // need to redo the timing using free running timer to get setPeriod and setNewPeriod working correctly - uint32_t newPeriod = us2ticks(us); - // uint32_t now = regs->CNT; - - // if (now > newPeriod) - // { - // (*pCallback)(); // might generate reentrance issues, not a good idea... - // } - - regs->OCR1 = newPeriod; - return errorCode::OK; - } - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTmap.h b/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTmap.h deleted file mode 100644 index cf62ea4..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/GPT/GPTmap.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "imxrt.h" -#include - -namespace TeensyTimerTool -{ - struct IMXRT_GPT_t - { - //51.7.1 GPT Control Register - volatile uint32_t CR; - //51.7.2 GPT Prescaler Register(GPTx_PR) - volatile uint32_t PR; - //51.7.3 GPT Status Register(GPTx_SR) - volatile uint32_t SR; - //51.7.4 GPT Interrupt Register(GPTx_IR) - volatile uint32_t IR; - //51.7.5 GPT Output Compare Register (GPTx_OCR1) - volatile uint32_t OCR1; - //51.7.6 GPT Output Compare Register (GPTx_OCR2) - volatile uint32_t OCR2; - //51.7.7 GPT Output Compare Register (GPTx_OCR3) - volatile uint32_t OCR3; - //51.7.8 GPT Input Capture Register 1 (GPTx_ICR1) - volatile uint32_t ICR1; - //51.7.9 GPT Input Capture Register 1 (GPTx_ICR2) - volatile uint32_t ICR2; - //51.7.10 GPT Counter Register (GPTx_CNT) - volatile uint32_t CNT; - }; - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/PIT4/PIT.cpp b/third-party/TeensyTimerTool/src/TimerModules/PIT4/PIT.cpp deleted file mode 100644 index 3229750..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/PIT4/PIT.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) || defined(ARDUINO_TEENSY_MICROMOD) - -#include "PIT.h" - -namespace TeensyTimerTool -{ - bool PIT_t::isInitialized = false; - PITChannel PIT_t::channel[4] = {{0}, {1}, {2}, {3}}; - - uint32_t PITChannel::clockFactor = 1; -} // namespace TeensyTimerTool - -#endif \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/PIT4/PIT.h b/third-party/TeensyTimerTool/src/TimerModules/PIT4/PIT.h deleted file mode 100644 index 50720cd..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/PIT4/PIT.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - -#include "PITChannel.h" - -namespace TeensyTimerTool -{ - class PIT_t - { - public: - inline static ITimerChannel *getTimer(); - - protected: - static bool isInitialized; - static void isr(); - static PITChannel channel[4]; - }; - - // IMPLEMENTATION =========================================================================== - - ITimerChannel *PIT_t::getTimer() - { - if (!isInitialized) - { - isInitialized = true; - - CCM_CCGR1 |= CCM_CCGR1_PIT(CCM_CCGR_ON); - PIT_MCR = 1; - - if (USE_GPT_PIT_150MHz) // timer clock setting from config.h - CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // FBus (usually 150MHz) - else - CCM_CSCMR1 |= CCM_CSCMR1_PERCLK_CLK_SEL; // 24MHz - - attachInterruptVector(IRQ_PIT, isr); - NVIC_ENABLE_IRQ(IRQ_PIT); - } - - for (unsigned i = 0; i < 4; i++) - { - if (channel[i].callback == nullptr) return &channel[i]; - } - return nullptr; - } - - inline void PIT_t::isr() - { - if (IMXRT_PIT_CHANNELS[0].TFLG) - { - IMXRT_PIT_CHANNELS[0].TFLG = 1; - channel[0].isr(); - } - if (IMXRT_PIT_CHANNELS[1].TFLG) - { - IMXRT_PIT_CHANNELS[1].TFLG = 1; - channel[1].isr(); - } - if (IMXRT_PIT_CHANNELS[2].TFLG) - { - IMXRT_PIT_CHANNELS[2].TFLG = 1; - channel[2].isr(); - } - if (IMXRT_PIT_CHANNELS[3].TFLG) - { - IMXRT_PIT_CHANNELS[3].TFLG = 1; - channel[3].isr(); - } - - asm volatile("dsb"); //wait until register changes propagated through the cache - } -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/TimerModules/PIT4/PITChannel.h b/third-party/TeensyTimerTool/src/TimerModules/PIT4/PITChannel.h deleted file mode 100644 index a018990..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/PIT4/PITChannel.h +++ /dev/null @@ -1,151 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "ITimerChannel.h" - -namespace TeensyTimerTool -{ - class PIT_t; - - class PITChannel : public ITimerChannel - { - public: - inline PITChannel(unsigned nr); - inline virtual ~PITChannel(); - - inline errorCode begin(callback_t cb, float tcnt, bool periodic) override; - //inline errorCode begin(callback_t cb, uint32_t tcnt, bool periodic) override; - inline errorCode start() override; - inline errorCode stop() override; - - //inline errorCode trigger(uint32_t) override; - inline errorCode trigger(float) override; - inline errorCode setNextPeriod(float us) override; - inline errorCode setPeriod(float us) override; - - inline float getMaxPeriod() const override; - - bool isPeriodic; - - protected: - //IMXRT_GPT_t* regs; - //uint32_t reload; - - inline void isr(); - - PITChannel() = delete; - PITChannel(const PITChannel &) = delete; - - const unsigned chNr; - callback_t callback = nullptr; - - static uint32_t clockFactor; - - friend PIT_t; - }; - - // IMPLEMENTATION ============================================== - - PITChannel::PITChannel(unsigned nr) - : ITimerChannel(nullptr), chNr(nr) - { - callback = nullptr; - clockFactor = (CCM_CSCMR1 & CCM_CSCMR1_PERCLK_CLK_SEL) ? 24 : (F_BUS_ACTUAL / 1000000); - } - - errorCode PITChannel::begin(callback_t cb, float micros, bool periodic) - { - isPeriodic = periodic; - callback = cb; - - if (isPeriodic) - { - IMXRT_PIT_CHANNELS[chNr].TCTRL = 0; - IMXRT_PIT_CHANNELS[chNr].TFLG = 1; - - setNextPeriod(micros); - // float tmp = micros * clockFactor; - // if (tmp > 0xFFFF'FFFF) - // { - // postError(errorCode::periodOverflow); - // IMXRT_PIT_CHANNELS[chNr].LDVAL = 0xFFFF'FFFE; - // } else - // { - // IMXRT_PIT_CHANNELS[chNr].LDVAL = (uint32_t)tmp - 1; - // } - } - return errorCode::OK; - } - - errorCode PITChannel::start() - { - IMXRT_PIT_CHANNELS[chNr].TCTRL = PIT_TCTRL_TEN | PIT_TCTRL_TIE; - return errorCode::OK; - } - - errorCode PITChannel::stop() - { - IMXRT_PIT_CHANNELS[chNr].TCTRL = 0; - return errorCode::OK; - } - - errorCode PITChannel::setNextPeriod(float us) - { - float cts = us * clockFactor; - if (cts > 0xFFFF'FFFF) - { - postError(errorCode::periodOverflow); - IMXRT_PIT_CHANNELS[chNr].LDVAL = 0xFFFF'FFFE; - } else - { - IMXRT_PIT_CHANNELS[chNr].LDVAL = (uint32_t)cts - 1; - } - return errorCode::OK; - } - - errorCode PITChannel::setPeriod(float us) - { - stop(); // need to stop/start timer to change current period (see ch 53.9.5.4) - setNextPeriod(us); - start(); - return errorCode::OK; - } - - void PITChannel::isr() - { - if (callback != nullptr) - { - callback(); - if (!isPeriodic) IMXRT_PIT_CHANNELS[chNr].TCTRL = 0; // switch off timer - } - } - - PITChannel::~PITChannel() - { - callback = nullptr; - } - - errorCode PITChannel::trigger(float delay) //should be optimized somehow - { - IMXRT_PIT_CHANNELS[chNr].TCTRL = 0; - IMXRT_PIT_CHANNELS[chNr].TFLG = 1; - - float tmp = delay * clockFactor; - if (tmp > 0xFFFF'FFFF) - { - postError(errorCode::periodOverflow); - IMXRT_PIT_CHANNELS[chNr].LDVAL = 0xFFFF'FFFE; - } else - IMXRT_PIT_CHANNELS[chNr].LDVAL = (uint32_t)tmp - 1; - - start(); - - return errorCode::OK; - } - - float PITChannel::getMaxPeriod() const - { - return (float)0xFFFF'FFFE / clockFactor / 1'000'000; - } - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/TCK/TCK.cpp b/third-party/TeensyTimerTool/src/TimerModules/TCK/TCK.cpp deleted file mode 100644 index a42bc77..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TCK/TCK.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "config.h" - -#if defined(TEENSYDUINO) - -#include "TCK.h" - -namespace TeensyTimerTool -{ - bool TCK_t::isInitialized = false; - TckChannelBase *TCK_t::channels[NR_OF_TCK_TIMERS]; -} // namespace TeensyTimerTool - -//---------------------------------------------------------------------- -#if YIELD_TYPE == YIELD_OPTIMIZED - -void yield() -{ - TeensyTimerTool::TCK_t::tick(); -} - -//---------------------------------------------------------------------- -#elif YIELD_TYPE == YIELD_STANDARD - -#include "EventResponder.h" - -namespace TeensyTimerTool -{ - static EventResponder er; - - void initYieldHook() - { - er.attach([](EventResponderRef r) { - TeensyTimerTool::TCK_t::tick(); - r.triggerEvent(); - }); - er.triggerEvent(); - } -} // namespace TeensyTimerTool -#endif -#endif diff --git a/third-party/TeensyTimerTool/src/TimerModules/TCK/TCK.h b/third-party/TeensyTimerTool/src/TimerModules/TCK/TCK.h deleted file mode 100644 index c697187..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TCK/TCK.h +++ /dev/null @@ -1,83 +0,0 @@ -#pragma once - -//#include "Arduino.h" -#include "TckChannel.h" -#include "core_pins.h" - -namespace TeensyTimerTool -{ - extern const unsigned NR_OF_TCK_TIMERS; - - class TCK_t - { - public: - template - static inline ITimerChannel *getTimer(); - static inline void removeTimer(TckChannelBase *); - static inline void tick(); - - protected: - static bool isInitialized; - static TckChannelBase *channels[NR_OF_TCK_TIMERS]; - }; - - // IMPLEMENTATION ================================================================== - - template - ITimerChannel *TCK_t::getTimer() - { - if (!isInitialized) - { - for (unsigned chNr = 0; chNr < NR_OF_TCK_TIMERS; chNr++) - { - channels[chNr] = nullptr; - } - isInitialized = true; - - // start the cycle counter if not already running - if (ARM_DWT_CYCCNT == ARM_DWT_CYCCNT) - { - ARM_DEMCR |= ARM_DEMCR_TRCENA; - ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA; - } - -// initialize the yield hook -#if defined(TEENSYDUINO) && YIELD_TYPE == YIELD_STANDARD - extern void initYieldHook(); - initYieldHook(); -#endif - } - for (unsigned chNr = 0; chNr < NR_OF_TCK_TIMERS; chNr++) - { - if (channels[chNr] == nullptr) - { - channels[chNr] = new TckChannel(); - return channels[chNr]; - } - } - return nullptr; - } - - void TCK_t::removeTimer(TckChannelBase *channel) - { - for (unsigned chNr = 0; chNr < NR_OF_TCK_TIMERS; chNr++) - { - if (channels[chNr] == channel) - { - channels[chNr] = nullptr; - break; - } - } - } - - void TCK_t::tick() - { - for (unsigned i = 0; i < NR_OF_TCK_TIMERS; i++) - { - if (channels[i] != nullptr) - { - channels[i]->tick(); - } - } - } -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannel.h b/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannel.h deleted file mode 100644 index 89274fc..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannel.h +++ /dev/null @@ -1,145 +0,0 @@ -#pragma once - -//#include "Arduino.h" -#include "ErrorHandling/error_codes.h" -#include "TckChannelBase.h" - -namespace TeensyTimerTool -{ - template // tckCounter is the underlying counter, e.g. 32bit cycle counter, RTC counter, micros counter etc - class TckChannel : public TckChannelBase - { - using counter_t = typename tckCounter::counter_t; // use the counter type (uint32_t, unit64_t...) of the used tckCounter class - - public: - TckChannel(); - - inline errorCode begin(callback_t cb, float period, bool periodic) override; - inline errorCode start() override; - inline errorCode stop() override; - - inline errorCode trigger(float delay_us) override; - inline errorCode triggerDirect(counter_t reload) override; - inline errorCode getTriggerReload(float delay, counter_t *reload) override; - - inline errorCode setNextPeriod(float us) override; - inline errorCode setPeriod(float us) override; - - float getMaxPeriod() const override { return tckCounter::getMaxMicros() / 1E6f; } // seconds - float getRemainingTime() const override { return (currentPeriod - (tckCounter::getCount() - startCnt)) / (float)TTT_F_CPU; } - - protected: - inline bool tick(); - callback_t callback; - counter_t startCnt, currentPeriod, nextPeriod; - - bool periodic; - bool triggered; - }; - - // IMPLEMENTATION ============================================== - - template - TckChannel::TckChannel() - { - triggered = false; - } - - template - errorCode TckChannel::begin(callback_t cb, float period, bool periodic) - { - this->triggered = false; - - this->periodic = periodic; - if (periodic) - { - this->currentPeriod = tckCounter::us2ticks(period); - this->nextPeriod = this->currentPeriod; - } - this->callback = cb; - - return errorCode::OK; - } - - template - errorCode TckChannel::start() - { - this->startCnt = tckCounter::getCount(); - this->triggered = true; - return errorCode::OK; - } - - template - errorCode TckChannel::stop() - { - this->triggered = false; - return errorCode::OK; - } - - template - errorCode TckChannel::triggerDirect(counter_t reload) - { - this->startCnt = tckCounter::getCount(); - this->nextPeriod = reload; - this->currentPeriod = this->nextPeriod; - this->triggered = true; - return errorCode::OK; - } - - template - errorCode TckChannel::trigger(float delay) // µs - { - return triggerDirect(tckCounter::us2ticks(delay)); - } - - template - errorCode TckChannel::getTriggerReload(float delay, counter_t *reload) - { - *reload = tckCounter::us2ticks(delay); - return errorCode::OK; - } - - template - errorCode TckChannel::setNextPeriod(float us) - { - nextPeriod = tckCounter::us2ticks(us); - return errorCode::OK; - } - - template - errorCode TckChannel::setPeriod(float us) - { - counter_t newPeriod = tckCounter::us2ticks(us); - counter_t now = tckCounter::getCount(); - - if (now - startCnt >= newPeriod) // new period already expired - { // - startCnt = now; // -> restart cycle but, - callback(); // since expired, invoke callback now - } // - currentPeriod = newPeriod; // in any case next callback will - nextPeriod = newPeriod; // be invoked after newly set period - return errorCode::OK; - } - - template - bool TckChannel::tick() - { - static bool lock = false; - counter_t now = tckCounter::getCount(); - if (!lock && this->currentPeriod != 0 && this->triggered && (now - this->startCnt) >= this->currentPeriod) - { - lock = true; - this->startCnt += currentPeriod; - this->currentPeriod = nextPeriod; // update period if it was changed during current cycle. - this->triggered = this->periodic; // i.e., stays triggerd if periodic, stops if oneShot - callback(); - lock = false; - return true; - } else - { - return false; - } - } - -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannelBase.cpp b/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannelBase.cpp deleted file mode 100644 index 0eeebe8..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannelBase.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#if defined(TEENSYDUINO) - -#include "TckChannelBase.h" -#include "Arduino.h" -#include "TCK.h" - -namespace TeensyTimerTool -{ - TckChannelBase::~TckChannelBase() - { - TCK_t::removeTimer(this); - } -} // namespace TeensyTimerTool - -#endif \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannelBase.h b/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannelBase.h deleted file mode 100644 index 79b834e..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TCK/TckChannelBase.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "../../ITimerChannel.h" - -namespace TeensyTimerTool -{ - class TckChannelBase : public ITimerChannel - { - public: - virtual bool tick() = 0; - virtual ~TckChannelBase(); - }; -} \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/TCK/tickCounters.cpp b/third-party/TeensyTimerTool/src/TimerModules/TCK/tickCounters.cpp deleted file mode 100644 index 8802010..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TCK/tickCounters.cpp +++ /dev/null @@ -1,103 +0,0 @@ - -#include "tickCounters.h" -#include "Arduino.h" -#include "types.h" -#include "boardDef.h" - -namespace TeensyTimerTool -{ - //--------------------------------------------------------------------- - // CycleCounter32 - - uint32_t CycleCounter32::getCount() - { - return ARM_DWT_CYCCNT; - } - - uint32_t CycleCounter32::us2ticks(float us) - { - return us * (TTT_F_CPU / 1E6f); - } - - float CycleCounter32::getMaxMicros() - { - return 5E6; //Can't use full 2^32 *1.66ns =7.2s range since we need some headroom to detect reaching target. This works if we call tick() at least once per 2 seconds - } - - //--------------------------------------------------------------------- - // CycleCounter64 - - uint64_t CycleCounter64::getCount() - { - static uint32_t lastCyCnt = ARM_DWT_CYCCNT; - static uint32_t curHIGH = 0; - - uint32_t now = ARM_DWT_CYCCNT; - if (now < lastCyCnt) - { - curHIGH++; - } - lastCyCnt = now; - return ((uint64_t)curHIGH << 32) | now; - } - - uint64_t CycleCounter64::us2ticks(float us) - { - return us * (TTT_F_CPU / 1E6f); - } - - float CycleCounter64::getMaxMicros() - { - return 2E16f; //~630 years can't use full 2^64 *1.66ns range since we need some headroom to detect reaching target. - } - - //------------------------------------------------------------------ - // MicrosCounter - - uint32_t MicrosCounter::getCount() - { - return micros(); - } - - uint32_t MicrosCounter::us2ticks(float us) - { - return us; - } - - float MicrosCounter::getMaxMicros() - { - return 70 * 60 * 1E6; // 70min, can't use full 2^32 µs = 72min range since we need some headroom to detect reaching target. This works if we call tick() at least once per 2min - } - -#if defined(TTT_TEENSY4X) - //------------------------------------------------------------------ - // RtcCounter - - uint64_t RtcCounter::getCount() - { - uint32_t hi1 = SNVS_HPRTCMR, lo1 = SNVS_HPRTCLR; - while (true) - { - uint32_t hi2 = SNVS_HPRTCMR, lo2 = SNVS_HPRTCLR; - if (lo1 == lo2 && hi1 == hi2) - { - return (uint64_t)hi2 << 32 | lo2; - } - hi1 = hi2; - lo1 = lo2; - } - } - - uint64_t RtcCounter::us2ticks(float us) - { - return us * (32'768 / 1E6f); - } - - float RtcCounter::getMaxMicros() - { - return 2E16f; // ~630 years - } - -#endif - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/TCK/tickCounters.h b/third-party/TeensyTimerTool/src/TimerModules/TCK/tickCounters.h deleted file mode 100644 index 225ea1b..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TCK/tickCounters.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once - -#include - -namespace TeensyTimerTool -{ - class CycleCounterBase - { - protected: - CycleCounterBase(); - }; - - //--------------------------------------------------------------------- - // Software counter based on the 32bit ARM cycle counter - // Resolution 1/FCPU_ACTUAL (1.66ns @600MHz) - // - struct CycleCounter32 : CycleCounterBase - { - using counter_t = uint32_t; - - static counter_t getCount(); - static uint32_t us2ticks(float us); - static float getMaxMicros(); - }; - - //--------------------------------------------------------------------- - // Software counter based on a 64bit extension of - // the ARM cycle counter - // Resolution 1/FCPU_ACTUAL (6.66ns @600MHz) - // - struct CycleCounter64 : CycleCounterBase - { - using counter_t = uint64_t; - - static uint64_t getCount(); - static uint64_t us2ticks(float us); - static float getMaxMicros(); - }; - - //------------------------------------------------------------------ - // Software counter based on the 64bit period counter - // of the built in real time clock (RTC). - // Resolution: 1/32768s (30.5 µs) - // - struct RtcCounter - { - using counter_t = uint64_t; - - static counter_t getCount(); - static counter_t us2ticks(float us); - static float getMaxMicros(); - }; - - //------------------------------------------------------------------ - // Fallback counter for boards without cycle counter - // E.g. Teensy LC - // Resolution: 1 µs - // - struct MicrosCounter - { - using counter_t = uint32_t; - - static counter_t getCount(); - static counter_t us2ticks(float us); - static float getMaxMicros(); - }; - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/TimerModules/TMR/TMR.h b/third-party/TeensyTimerTool/src/TimerModules/TMR/TMR.h deleted file mode 100644 index 2e1e526..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TMR/TMR.h +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -#include "TMRChannel.h" -#include "imxrt.h" - -namespace TeensyTimerTool -{ - template - class TMR_t - { - public: - static ITimerChannel *getTimer(); - - protected: - static bool isInitialized; - static void isr(); - static callback_t callbacks[4]; - - // the following is calculated at compile time - static constexpr IRQ_NUMBER_t irq = moduleNr == 0 ? IRQ_QTIMER1 : moduleNr == 1 ? IRQ_QTIMER2 - : moduleNr == 2 ? IRQ_QTIMER3 - : IRQ_QTIMER4; - static IMXRT_TMR_t *const pTMR; - static IMXRT_TMR_CH_t *const pCH0; - static IMXRT_TMR_CH_t *const pCH1; - static IMXRT_TMR_CH_t *const pCH2; - static IMXRT_TMR_CH_t *const pCH3; - - static_assert(moduleNr < 4, "Module number < 4 required"); - }; - - // IMPLEMENTATION ================================================================== - - template IMXRT_TMR_t *const TMR_t::pTMR = moduleNr == 0 ? &IMXRT_TMR1 : moduleNr == 1 ? &IMXRT_TMR2 - : moduleNr == 2 ? &IMXRT_TMR3 - : &IMXRT_TMR4; - template IMXRT_TMR_CH_t *const TMR_t::pCH0 = &pTMR->CH[0]; - template IMXRT_TMR_CH_t *const TMR_t::pCH1 = &pTMR->CH[1]; - template IMXRT_TMR_CH_t *const TMR_t::pCH2 = &pTMR->CH[2]; - template IMXRT_TMR_CH_t *const TMR_t::pCH3 = &pTMR->CH[3]; - - template - ITimerChannel *TMR_t::getTimer() - { - if (!isInitialized) - { - for (unsigned chNr = 0; chNr < 4; chNr++) - { - pTMR->CH[chNr].CTRL = 0x0000; - callbacks[chNr] = nullptr; - } - attachInterruptVector(irq, isr); // start - NVIC_ENABLE_IRQ(irq); - isInitialized = true; - return new TMRChannel(pCH0, &callbacks[0]); - } - - for (unsigned chNr = 0; chNr < 4; chNr++) - { - IMXRT_TMR_CH_t *pCh = &pTMR->CH[chNr]; - if (pCh->CTRL == 0x0000) - { - return new TMRChannel(pCh, &callbacks[chNr]); - } - } - return nullptr; - } - - template - void TMR_t::isr() - { - // no loop to gain some time by avoiding indirections and pointer calculations - if (callbacks[0] != nullptr && pCH0->CSCTRL & TMR_CSCTRL_TCF1) - { - pCH0->CSCTRL &= ~TMR_CSCTRL_TCF1; - callbacks[0](); - } - - if (callbacks[1] != nullptr && pCH1->CSCTRL & TMR_CSCTRL_TCF1) - { - pCH1->CSCTRL &= ~TMR_CSCTRL_TCF1; - callbacks[1](); - } - - if (callbacks[2] != nullptr && pCH2->CSCTRL & TMR_CSCTRL_TCF1) - { - pCH2->CSCTRL &= ~TMR_CSCTRL_TCF1; - callbacks[2](); - } - - if (callbacks[3] != nullptr && pCH3->CSCTRL & TMR_CSCTRL_TCF1) - { - pCH3->CSCTRL &= ~TMR_CSCTRL_TCF1; - callbacks[3](); - } - asm volatile("dsb"); //wait until register changes propagated through the cache - } - - template - bool TMR_t::isInitialized = false; - - template - callback_t TMR_t::callbacks[4]; -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/TimerModules/TMR/TMRChannel.h b/third-party/TeensyTimerTool/src/TimerModules/TMR/TMRChannel.h deleted file mode 100644 index 0e45de9..0000000 --- a/third-party/TeensyTimerTool/src/TimerModules/TMR/TMRChannel.h +++ /dev/null @@ -1,188 +0,0 @@ -#pragma once -#include "../../ITimerChannel.h" -//#include "Arduino.h" -#include "ErrorHandling/error_codes.h" -#include "config.h" -#include "imxrt.h" -#include - -namespace TeensyTimerTool -{ - class TMRChannel : public ITimerChannel - { - public: - inline TMRChannel(IMXRT_TMR_CH_t *regs, callback_t *cbStorage); - inline virtual ~TMRChannel(); - - inline errorCode begin(callback_t cb, float tcnt, bool periodic) override; - inline errorCode start() override; - inline errorCode stop() override; - - inline errorCode trigger(float tcnt) override; - inline float getMaxPeriod() const override; - - inline errorCode setPeriod(float us) override; - inline errorCode setNextPeriod(float us) override; - inline void setPrescaler(uint32_t psc); // psc 0..7 -> prescaler: 1..128 - - protected: - IMXRT_TMR_CH_t *regs; - callback_t **pCallback = nullptr; - float pscValue; - uint32_t pscBits; - - errorCode us2Ticks(const float us, uint16_t *ticks) const; - inline float_t counterToMicrosecond(const float_t cnt) const; - }; - - // IMPLEMENTATION ============================================== - - TMRChannel::TMRChannel(IMXRT_TMR_CH_t *regs, callback_t *cbStorage) - : ITimerChannel(cbStorage) - { - this->regs = regs; - setPrescaler(TMR_DEFAULT_PSC); - } - - TMRChannel::~TMRChannel() - { - regs->CTRL = 0x0000; // stop timer and mark it free - } - - errorCode TMRChannel::start() - { - regs->CNTR = 0x0000; - - regs->CSCTRL &= ~TMR_CSCTRL_TCF1; - regs->CSCTRL |= TMR_CSCTRL_TCF1EN; - return errorCode::OK; - } - - errorCode TMRChannel::stop() - { - regs->CSCTRL &= ~TMR_CSCTRL_TCF1EN; - return errorCode::OK; - } - - errorCode TMRChannel::begin(callback_t cb, float period, bool periodic) - { - uint16_t reload; - errorCode status = us2Ticks(period, &reload); - - regs->CTRL = 0x0000; - regs->LOAD = 0x0000; - regs->COMP1 = reload; - regs->CMPLD1 = reload; - regs->CNTR = 0x0000; - regs->CSCTRL = TMR_CSCTRL_CL1(1); - setCallback(cb); - - if (!periodic) - regs->CTRL = TMR_CTRL_CM(1) | TMR_CTRL_PCS(pscBits) | TMR_CTRL_ONCE | TMR_CTRL_LENGTH; - - else - regs->CTRL = TMR_CTRL_CM(1) | TMR_CTRL_PCS(pscBits) | TMR_CTRL_LENGTH; - - start(); - return status; - } - - errorCode TMRChannel::trigger(float us) // quick and dirty, should be optimized - { - // const float_t t = us2Ticks(tcnt); - // uint16_t reload = t > 0xFFFF ? 0xFFFF : (uint16_t)t; - - uint16_t reload; - errorCode status = us2Ticks(us, &reload); - - regs->CTRL = 0x0000; - regs->LOAD = 0x0000; - regs->COMP1 = reload; - regs->CMPLD1 = reload; - regs->CNTR = 0x0000; - - regs->CSCTRL &= ~TMR_CSCTRL_TCF1; - regs->CSCTRL |= TMR_CSCTRL_TCF1EN; - - regs->CTRL = TMR_CTRL_CM(1) | TMR_CTRL_PCS(pscBits) | TMR_CTRL_ONCE | TMR_CTRL_LENGTH; - - return status; - } - - void TMRChannel::setPrescaler(uint32_t psc) // psc 0..7 -> prescaler: 1..128 - { - pscValue = 1 << (psc & 0b0111); - pscBits = 0b1000 | (psc & 0b0111); - } - - float TMRChannel::getMaxPeriod() const - { - return pscValue / 150'000'000.0f * 0xFFFE; - } - - errorCode TMRChannel::setNextPeriod(float us) - { - uint16_t reload; - errorCode status = us2Ticks(us, &reload); - regs->CMPLD1 = reload; - return status; - } - - // errorCode TMRChannel::_setCurrentPeriod(const uint16_t cnt) - // { - - // regs->COMP1 = cnt; - - // //Do we need to wait some cycle for IP bus to update here / cache flush? - // //asm volatile("dsb"); - - // if (regs->CNTR > cnt) - // { - // //if counter alrready went over setted value force a triggering - // regs->CNTR = cnt; - // return errorCode::triggeredLate; - // } - - // else - // { - // return errorCode::OK; - // } - // } - - errorCode TMRChannel::setPeriod(float us) - { - uint16_t newReload; - errorCode status = us2Ticks(us, &newReload); - - regs->CMPLD1 = newReload; // counter will load this value to COMP1 at next trigger - // - noInterrupts(); // interrupting this code could lead to wrong cntr settings - if (regs->CNTR > newReload) // already too late for new period - regs->CNTR = regs->COMP1; // -> force trigger; will also load COMP1 with value from CMPLD1 - else // not too late - regs->COMP1 = newReload; // -> change current compare value to new one (counter _might_ be > newReload in between.. watch and fix if necessary) - interrupts(); - - return status; - } - - errorCode TMRChannel::us2Ticks(const float us, uint16_t *ticks) const - { - constexpr uint16_t maxTicks = 0xFFFE; - - float tmpTicks = us * 150.0f / pscValue; - if (tmpTicks > maxTicks) - { - *ticks = maxTicks; - return errorCode::periodOverflow; - } - *ticks = (uint16_t)tmpTicks; - return errorCode::OK; - } - - float_t TMRChannel::counterToMicrosecond(const float_t cnt) const - { - return cnt * pscValue / 150.0f; - } - -} // namespace TeensyTimerTool diff --git a/third-party/TeensyTimerTool/src/boardDef.h b/third-party/TeensyTimerTool/src/boardDef.h deleted file mode 100644 index 115a3a4..0000000 --- a/third-party/TeensyTimerTool/src/boardDef.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once -#include - -namespace TeensyTimerTool -{ - class ITimerChannel; - using TimerGenerator = ITimerChannel*(); //returns a pointer to a free timer channel or nullptr - - // TEENSYDUINO ========================================================================== - #if defined(TEENSYDUINO) - #if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) || defined(ARDUINO_TEENSY_MICROMOD) - #define TTT_TEENSY4X - #elif defined(ARDUINO_TEENSY30) || defined(ARDUINO_TEENSY31) || defined(ARDUINO_TEENSY32) || defined(ARDUINO_TEENSY35) || defined(ARDUINO_TEENSY36) - #define TTT_TEENSY3X - #endif - - #if defined(ARDUINO_TEENSYLC) - extern TimerGenerator *const TCK; - - #elif defined(ARDUINO_TEENSY30) - extern TimerGenerator *const FTM0, * const FTM1; - extern TimerGenerator *const TCK, * const TCK32, * const TCK64; - - #elif defined(ARDUINO_TEENSY31) || defined(ARDUINO_TEENSY32) - extern TimerGenerator *const FTM0, * const FTM1, * const FTM2; - extern TimerGenerator *const TCK, * const TCK32, * const TCK64; - - - #elif defined(ARDUINO_TEENSY35) - extern TimerGenerator *const FTM0, * const FTM1, * const FTM2, * const FTM3, * const FTM4; - extern TimerGenerator *const TCK, * const TCK32, * const TCK64; - - #elif defined(ARDUINO_TEENSY36) - extern TimerGenerator *const FTM0, *const FTM1, *const FTM2, *const FTM3, *const FTM4; - extern TimerGenerator *const TCK, * const TCK32, * const TCK64; - - #elif defined(TTT_TEENSY4X) - extern TimerGenerator *const TMR1, *const TMR2, *const TMR3, *const TMR4; - extern TimerGenerator *const GPT1, *const GPT2; - extern TimerGenerator *const PIT; - extern TimerGenerator *const TCK, * const TCK32, * const TCK64, *const TCK_RTC; - - #else - #error BOARD NOT SUPPORTED - #endif - - #define YIELD_NONE 0 - #define YIELD_STANDARD 1 - #define YIELD_OPTIMIZED 2 - - constexpr int PSC_AUTO = -1; - constexpr int PSC_1 = 0; - constexpr int PSC_2 = 1; - constexpr int PSC_4 = 2; - constexpr int PSC_8 = 3; - constexpr int PSC_16 = 4; - constexpr int PSC_32 = 5; - constexpr int PSC_64 = 6; - constexpr int PSC_128 = 7; - - extern void(* const tick)(); - - - #else - # error "Board not supported" - #endif -} \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/config.cpp b/third-party/TeensyTimerTool/src/config.cpp deleted file mode 100644 index d7b47f3..0000000 --- a/third-party/TeensyTimerTool/src/config.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "config.h" -#include "TimerModules/TCK/TCK.h" -#include "TimerModules/TCK/tickCounters.h" -#include "boardDef.h" - -using tick_t = void (*)(); - -#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41) || defined(ARDUINO_TEENSY_MICROMOD) -#include "TimerModules/GPT/GPT.h" -#include "TimerModules/PIT4/PIT.h" -#include "TimerModules/TMR/TMR.h" - -namespace TeensyTimerTool -{ - TimerGenerator *const TMR1 = TMR_t<0>::getTimer; - TimerGenerator *const TMR2 = TMR_t<1>::getTimer; - TimerGenerator *const TMR3 = TMR_t<2>::getTimer; - TimerGenerator *const TMR4 = TMR_t<3>::getTimer; - - TimerGenerator *const GPT1 = GPT_t<0>::getTimer; - TimerGenerator *const GPT2 = GPT_t<1>::getTimer; - - TimerGenerator *const PIT = PIT_t::getTimer; - - TimerGenerator *const TCK = TCK_t::getTimer; - TimerGenerator *const TCK32 = TCK_t::getTimer; // same as TCK - TimerGenerator *const TCK64 = TCK_t::getTimer; - TimerGenerator *const TCK_RTC = TCK_t::getTimer; - - constexpr tick_t tick = &TCK_t::tick; -} // namespace TeensyTimerTool - -#elif defined(ARDUINO_TEENSY35) || defined(ARDUINO_TEENSY36) -#include "TimerModules/FTM/FTM.h" - -namespace TeensyTimerTool -{ - TimerGenerator *const TCK = TCK_t::getTimer; - TimerGenerator *const TCK32 = TCK_t::getTimer; // same as TCK - TimerGenerator *const TCK64 = TCK_t::getTimer; - - TimerGenerator *const FTM0 = FTM_t<0>::getTimer; - TimerGenerator *const FTM1 = FTM_t<1>::getTimer; - TimerGenerator *const FTM2 = FTM_t<2>::getTimer; - TimerGenerator *const FTM3 = FTM_t<3>::getTimer; - TimerGenerator *const FTM4 = FTM_t<3>::getTimer; - - constexpr tick_t tick = &TCK_t::tick; -} // namespace TeensyTimerTool - -#elif defined(ARDUINO_TEENSY31) || defined(ARDUINO_TEENSY32) -#include "TimerModules/FTM/FTM.h" - -namespace TeensyTimerTool -{ - TimerGenerator *const TCK = TCK_t::getTimer; - TimerGenerator *const TCK32 = TCK_t::getTimer; // same as TCK - TimerGenerator *const TCK64 = TCK_t::getTimer; - - TimerGenerator *const FTM0 = FTM_t<0>::getTimer; - TimerGenerator *const FTM1 = FTM_t<1>::getTimer; - TimerGenerator *const FTM2 = FTM_t<2>::getTimer; - constexpr tick_t tick = &TCK_t::tick; -} // namespace TeensyTimerTool - -#elif defined(ARDUINO_TEENSY30) -#include "TimerModules/FTM/FTM.h" - -namespace TeensyTimerTool -{ - TimerGenerator *const TCK = TCK_t::getTimer; - TimerGenerator *const TCK32 = TCK_t::getTimer; // same as TCK - TimerGenerator *const TCK64 = TCK_t::getTimer; - - TimerGenerator *const FTM0 = FTM_t<0>::getTimer; - TimerGenerator *const FTM1 = FTM_t<1>::getTimer; - constexpr tick_t tick = &TCK_t::tick; -} // namespace TeensyTimerTool - -#elif defined(ARDUINO_TEENSYLC) - -namespace TeensyTimerTool -{ - TimerGenerator *const TCK = TCK_t::getTimer; - constexpr tick_t tick = &TCK_t::tick; -} // namespace TeensyTimerTool - -#endif diff --git a/third-party/TeensyTimerTool/src/config.h b/third-party/TeensyTimerTool/src/config.h deleted file mode 100644 index d74a5dd..0000000 --- a/third-party/TeensyTimerTool/src/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#if __has_include("userConfig.h") -#include "userConfig.h" -#else -#include "defaultConfig.h" -#endif diff --git a/third-party/TeensyTimerTool/src/defaultConfig.h b/third-party/TeensyTimerTool/src/defaultConfig.h deleted file mode 100644 index 917ce68..0000000 --- a/third-party/TeensyTimerTool/src/defaultConfig.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -#include "boardDef.h" -namespace TeensyTimerTool -{ -//-------------------------------------------------------------------------------------------- -// Timer pool defintion -// Add, and sort and remove to define the timer pool. Timers will be allocted from left to right - -#if defined(ARDUINO_TEENSY_MICROMOD) - TimerGenerator* const timerPool[] = {GPT1, GPT2, TMR1, TMR2, TMR3, TMR4, TCK}; - -#elif defined(ARDUINO_TEENSY40) - TimerGenerator* const timerPool[] = {GPT1, GPT2, TMR1, TMR2, TMR3, TMR4, TCK}; - -#elif defined(ARDUINO_TEENSY41) - TimerGenerator* const timerPool[] = {GPT1, GPT2, TMR1, TMR2, TMR3, TMR4, TCK}; - -#elif defined(ARDUINO_TEENSY36) - TimerGenerator* const timerPool[] = {FTM0, FTM1, FTM2, FTM3, FTM4, TCK}; - -#elif defined(ARDUINO_TEENSY35) - TimerGenerator* const timerPool[] = {FTM0, FTM1, FTM2, FTM3, TCK}; - -#elif defined(ARDUINO_TEENSY31) || defined(ARDUINO_TEENSY32) - TimerGenerator* const timerPool[] = {FTM0, FTM1, FTM2, TCK}; - -#elif defined(ARDUINO_TEENSY30) - TimerGenerator* const timerPool[] = {FTM0, FTM1, TCK}; - -#elif defined(ARDUINO_TEENSYLC) - TimerGenerator* const timerPool[] = {TCK}; - -#elif defined(ESP32) - TimerGenerator* const timerPool[] = {TCK}; - -#elif defined(UNO) - TimerGenerator* const timerPool[] = {TCK}; -#endif - constexpr unsigned timerCnt = sizeof(timerPool) / sizeof(timerPool[0]); - -//-------------------------------------------------------------------------------------------- -// Default settings for various timers - -// TMR (QUAD) - constexpr int TMR_DEFAULT_PSC = PSC_128; // Allowed prescaling values: PSC_1, PSC_2, PSC_4 ... PSC_128, clock = 150MHz - -// FTM - constexpr int FTM_DEFAULT_PSC[] = // Allowed prescaling values: PSC_AUTO, PSC_1, PSC_2, PSC_4 ... PSC_128, clock = FBUS - { // (PSC_AUTO adjusts prescaler to get roughly 2 timer ticks per µs) - /*FTM0*/ PSC_AUTO, - /*FTM1*/ PSC_AUTO, - /*FTM2*/ PSC_AUTO, - /*FTM3*/ PSC_AUTO - }; - - -// GPT & PID - constexpr bool USE_GPT_PIT_150MHz = false;// changes the clock source for GPT and PIT from 24MHz (standard) to 150MHz, might have side effects! - -// TCK - constexpr unsigned NR_OF_TCK_TIMERS = 20; // How many TCK timers shall be available - - #define YIELD_TYPE YIELD_STANDARD // Select the required yield strategy from the list below - // YIELD_NONE: lib doesn't touch yield. Make sure to call TeensyTimerTool::tick as often as possible - // YIELD_STANDARD: uses the standard yield function and adds a call to TeensyTimerTool::tick(). Lots of overhead in yield... - // YIELD_OPTIMIZED: generate an optimized yield which only calls TeensyTimerTool::Tick() (recommended if you don't use SerialEvents) - - - - -//-------------------------------------------------------------------------------------------- -// Callback type -// Uncomment if you prefer function pointer callbacks instead of std::function callbacks - -// #define PLAIN_VANILLA_CALLBACKS - - -//-------------------------------------------------------------------------------------------- -// Use c++14 time literals (e.g. 3.4s, 50ms, _kHz...) for time inputs. Periods without literals are -// interpreted as microseconds. -// Comment the following line if you don't want this. - - #define USE_TIME_LITERALS - - -//-------------------------------------------------------------------------------------------- -// Advanced Features -// Uncomment if you need access to advanced features - -// #define ENABLE_ADVANCED_FEATURES -} \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/frequency.h b/third-party/TeensyTimerTool/src/frequency.h deleted file mode 100644 index 832056c..0000000 --- a/third-party/TeensyTimerTool/src/frequency.h +++ /dev/null @@ -1,406 +0,0 @@ -// -*- C++ -*- - -// Copyright (C) 2008-2015 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -#pragma once - -#include -#include -#include -#include - -using std::common_type; -using std::enable_if; -using std::is_convertible; -using std::ratio; -using std::ratio_divide; - -namespace TeensyTimerTool -{ - template > - struct frequency; - - template - struct __frequency_common_type_wrapper - { - private: - typedef std::__static_gcd<_Period1::num, _Period2::num> __gcd_num; - typedef std::__static_gcd<_Period1::den, _Period2::den> __gcd_den; - typedef typename _CT::type __cr; - typedef ratio<__gcd_num::value, - (_Period1::den / __gcd_den::value) * _Period2::den> - __r; - - public: - typedef std::__success_type> type; - }; - - template - struct __frequency_common_type_wrapper - { - typedef std::__failure_type type; - }; -} - -namespace std -{ - template - struct common_type, TeensyTimerTool::frequency<_Rep2, _Period2>> - : public TeensyTimerTool::__frequency_common_type_wrapper>::type, _Period1, _Period2>::type - { - }; -} - -namespace TeensyTimerTool -{ - using namespace std::chrono; - - // Primary template for frequency_cast impl. - template - struct __frequency_cast_impl - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>(static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num) / static_cast<_CR>(_CF::den))); - } - }; - - template - struct __frequency_cast_impl<_ToDur, _CF, _CR, true, true> - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>(__d.count())); - } - }; - - template - struct __frequency_cast_impl<_ToDur, _CF, _CR, true, false> - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>( - static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den))); - } - }; - - template - struct __frequency_cast_impl<_ToDur, _CF, _CR, false, true> - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>( - static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num))); - } - }; - - template - struct __is_frequency - : std::false_type - { - }; - - template - struct __is_frequency> - : std::true_type - { - }; - - /// duration_cast - template - constexpr typename enable_if<__is_frequency<_ToDur>::value, _ToDur>::type duration_cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::period __to_period; - typedef typename _ToDur::rep __to_rep; - typedef ratio_divide<_Period, __to_period> __cf; - typedef typename common_type<__to_rep, _Rep, intmax_t>::type __cr; - typedef __frequency_cast_impl<_ToDur, __cf, __cr, __cf::num == 1, __cf::den == 1> __dc; - - return __dc::__cast(__d); - } - - /// frequency - template - struct frequency - { - typedef _Rep rep; - typedef _Period period; - - static_assert(!__is_frequency<_Rep>::value, "rep cannot be a frequency"); - static_assert(std::chrono::__is_ratio<_Period>::value, "period must be a specialization of ratio"); - static_assert(_Period::num > 0, "period must be positive"); - - // 20.11.5.1 construction / copy / destroy - constexpr frequency() = default; - - // NB: Make constexpr implicit. This cannot be explicitly - // constexpr, as any UDT that is not a literal type with a - // constexpr copy constructor will be ill-formed. - frequency(const frequency&) = default; - - template ::value && (std::chrono::treat_as_floating_point::value || !std::chrono::treat_as_floating_point<_Rep2>::value)>::type> - constexpr explicit frequency(const _Rep2& __rep) - : __r(static_cast(__rep)) - { - } - - template ::value || (ratio_divide<_Period2, period>::den == 1 && !treat_as_floating_point<_Rep2>::value)>::type> - constexpr frequency(const frequency<_Rep2, _Period2>& __d) - : __r(duration_cast(__d).count()) {} - - ~frequency() = default; - frequency& operator=(const frequency&) = default; - - // 20.11.5.2 observer - constexpr rep count() const { return __r; } - - constexpr frequency operator+() const { return *this; } - constexpr frequency operator-() const { return frequency(-__r); } - - frequency& operator++() - { - ++__r; - return *this; - } - - frequency operator++(int) - { - return frequency(__r++); - } - - frequency& operator--() - { - --__r; - return *this; - } - - frequency - operator--(int) - { - return frequency(__r--); - } - - frequency& - operator+=(const frequency& __d) - { - __r += __d.count(); - return *this; - } - - frequency& - operator-=(const frequency& __d) - { - __r -= __d.count(); - return *this; - } - - frequency& - operator*=(const rep& __rhs) - { - __r *= __rhs; - return *this; - } - - frequency& - operator/=(const rep& __rhs) - { - __r /= __rhs; - return *this; - } - - // DR 934. - template - typename enable_if::value, - frequency&>::type - operator%=(const rep& __rhs) - { - __r %= __rhs; - return *this; - } - - template - typename enable_if::value, - frequency&>::type - operator%=(const frequency& __d) - { - __r %= __d.count(); - return *this; - } - - // 20.11.5.4 special values - static constexpr frequency - zero() - { - return frequency(duration_values::zero()); - } - - static constexpr frequency - min() - { - return frequency(duration_values::min()); - } - - static constexpr frequency - max() - { - return frequency(duration_values::max()); - } - - private: - rep __r; - }; - - template - constexpr typename common_type, frequency<_Rep2, _Period2>>::type operator+(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__cd(__lhs).count() + __cd(__rhs).count()); - } - - template - constexpr typename common_type, frequency<_Rep2, _Period2>>::type operator-(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__cd(__lhs).count() - __cd(__rhs).count()); - } - - template - constexpr frequency::type, _Period> operator*(const frequency<_Rep1, _Period>& __d, const _Rep2& __s) - { - typedef frequency::type, _Period> __cd; - return __cd(__cd(__d).count() * __s); - } - - template - constexpr frequency::type, _Period> operator*(const _Rep1& __s, const frequency<_Rep2, _Period>& __d) - { - return __d * __s; - } - - template - constexpr frequency::value, _Rep2>::type>::type, _Period> operator/(const frequency<_Rep1, _Period>& __d, const _Rep2& __s) - { - typedef frequency::type, _Period> __cd; - return __cd(__cd(__d).count() / __s); - } - - template - constexpr typename common_type<_Rep1, _Rep2>::type operator/(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__lhs).count() / __cd(__rhs).count(); - } - - // DR 934. - template - constexpr frequency::value, _Rep2>::type>::type, _Period> operator%(const frequency<_Rep1, _Period>& __d, const _Rep2& __s) - { - typedef frequency::type, _Period> __cd; - return __cd(__cd(__d).count() % __s); - } - - template - constexpr typename common_type, frequency<_Rep2, _Period2>>::type operator%(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__cd(__lhs).count() % __cd(__rhs).count()); - } - - // comparisons - template - constexpr bool operator==(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __ct; - return __ct(__lhs).count() == __ct(__rhs).count(); - } - - template - constexpr bool operator<(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __ct; - return __ct(__lhs).count() < __ct(__rhs).count(); - } - - template - constexpr bool operator!=(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return !(__lhs == __rhs); - } - - template - constexpr bool operator<=(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return !(__rhs < __lhs); - } - - template - constexpr bool operator>(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return __rhs < __lhs; - } - - template - constexpr bool operator>=(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return !(__lhs < __rhs); - } - - using hertz = frequency; - using kilohertz = frequency; - using megahertz = frequency; - using gigahertz = frequency; - - constexpr hertz operator""_Hz(long double hz) { return hertz{hz}; } - constexpr hertz operator""_Hz(uint64_t hz) { return hertz{hz}; } - constexpr kilohertz operator""_kHz(long double kHz) { return kilohertz{kHz}; } - constexpr kilohertz operator""_kHz(uint64_t kHz) { return kilohertz{kHz}; } - constexpr megahertz operator""_MHz(long double MHz) { return megahertz{MHz}; } - constexpr megahertz operator""_MHz(uint64_t MHz) { return megahertz{MHz}; } - constexpr gigahertz operator""_GHz(long double GHz) { return gigahertz{GHz}; } - constexpr gigahertz operator""_GHz(uint64_t GHz) { return gigahertz{GHz}; } -} diff --git a/third-party/TeensyTimerTool/src/frequency.h.deactivated b/third-party/TeensyTimerTool/src/frequency.h.deactivated deleted file mode 100644 index 832056c..0000000 --- a/third-party/TeensyTimerTool/src/frequency.h.deactivated +++ /dev/null @@ -1,406 +0,0 @@ -// -*- C++ -*- - -// Copyright (C) 2008-2015 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -#pragma once - -#include -#include -#include -#include - -using std::common_type; -using std::enable_if; -using std::is_convertible; -using std::ratio; -using std::ratio_divide; - -namespace TeensyTimerTool -{ - template > - struct frequency; - - template - struct __frequency_common_type_wrapper - { - private: - typedef std::__static_gcd<_Period1::num, _Period2::num> __gcd_num; - typedef std::__static_gcd<_Period1::den, _Period2::den> __gcd_den; - typedef typename _CT::type __cr; - typedef ratio<__gcd_num::value, - (_Period1::den / __gcd_den::value) * _Period2::den> - __r; - - public: - typedef std::__success_type> type; - }; - - template - struct __frequency_common_type_wrapper - { - typedef std::__failure_type type; - }; -} - -namespace std -{ - template - struct common_type, TeensyTimerTool::frequency<_Rep2, _Period2>> - : public TeensyTimerTool::__frequency_common_type_wrapper>::type, _Period1, _Period2>::type - { - }; -} - -namespace TeensyTimerTool -{ - using namespace std::chrono; - - // Primary template for frequency_cast impl. - template - struct __frequency_cast_impl - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>(static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num) / static_cast<_CR>(_CF::den))); - } - }; - - template - struct __frequency_cast_impl<_ToDur, _CF, _CR, true, true> - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>(__d.count())); - } - }; - - template - struct __frequency_cast_impl<_ToDur, _CF, _CR, true, false> - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>( - static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den))); - } - }; - - template - struct __frequency_cast_impl<_ToDur, _CF, _CR, false, true> - { - template - static constexpr _ToDur - __cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::rep __to_rep; - return _ToDur(static_cast<__to_rep>( - static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num))); - } - }; - - template - struct __is_frequency - : std::false_type - { - }; - - template - struct __is_frequency> - : std::true_type - { - }; - - /// duration_cast - template - constexpr typename enable_if<__is_frequency<_ToDur>::value, _ToDur>::type duration_cast(const frequency<_Rep, _Period>& __d) - { - typedef typename _ToDur::period __to_period; - typedef typename _ToDur::rep __to_rep; - typedef ratio_divide<_Period, __to_period> __cf; - typedef typename common_type<__to_rep, _Rep, intmax_t>::type __cr; - typedef __frequency_cast_impl<_ToDur, __cf, __cr, __cf::num == 1, __cf::den == 1> __dc; - - return __dc::__cast(__d); - } - - /// frequency - template - struct frequency - { - typedef _Rep rep; - typedef _Period period; - - static_assert(!__is_frequency<_Rep>::value, "rep cannot be a frequency"); - static_assert(std::chrono::__is_ratio<_Period>::value, "period must be a specialization of ratio"); - static_assert(_Period::num > 0, "period must be positive"); - - // 20.11.5.1 construction / copy / destroy - constexpr frequency() = default; - - // NB: Make constexpr implicit. This cannot be explicitly - // constexpr, as any UDT that is not a literal type with a - // constexpr copy constructor will be ill-formed. - frequency(const frequency&) = default; - - template ::value && (std::chrono::treat_as_floating_point::value || !std::chrono::treat_as_floating_point<_Rep2>::value)>::type> - constexpr explicit frequency(const _Rep2& __rep) - : __r(static_cast(__rep)) - { - } - - template ::value || (ratio_divide<_Period2, period>::den == 1 && !treat_as_floating_point<_Rep2>::value)>::type> - constexpr frequency(const frequency<_Rep2, _Period2>& __d) - : __r(duration_cast(__d).count()) {} - - ~frequency() = default; - frequency& operator=(const frequency&) = default; - - // 20.11.5.2 observer - constexpr rep count() const { return __r; } - - constexpr frequency operator+() const { return *this; } - constexpr frequency operator-() const { return frequency(-__r); } - - frequency& operator++() - { - ++__r; - return *this; - } - - frequency operator++(int) - { - return frequency(__r++); - } - - frequency& operator--() - { - --__r; - return *this; - } - - frequency - operator--(int) - { - return frequency(__r--); - } - - frequency& - operator+=(const frequency& __d) - { - __r += __d.count(); - return *this; - } - - frequency& - operator-=(const frequency& __d) - { - __r -= __d.count(); - return *this; - } - - frequency& - operator*=(const rep& __rhs) - { - __r *= __rhs; - return *this; - } - - frequency& - operator/=(const rep& __rhs) - { - __r /= __rhs; - return *this; - } - - // DR 934. - template - typename enable_if::value, - frequency&>::type - operator%=(const rep& __rhs) - { - __r %= __rhs; - return *this; - } - - template - typename enable_if::value, - frequency&>::type - operator%=(const frequency& __d) - { - __r %= __d.count(); - return *this; - } - - // 20.11.5.4 special values - static constexpr frequency - zero() - { - return frequency(duration_values::zero()); - } - - static constexpr frequency - min() - { - return frequency(duration_values::min()); - } - - static constexpr frequency - max() - { - return frequency(duration_values::max()); - } - - private: - rep __r; - }; - - template - constexpr typename common_type, frequency<_Rep2, _Period2>>::type operator+(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__cd(__lhs).count() + __cd(__rhs).count()); - } - - template - constexpr typename common_type, frequency<_Rep2, _Period2>>::type operator-(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__cd(__lhs).count() - __cd(__rhs).count()); - } - - template - constexpr frequency::type, _Period> operator*(const frequency<_Rep1, _Period>& __d, const _Rep2& __s) - { - typedef frequency::type, _Period> __cd; - return __cd(__cd(__d).count() * __s); - } - - template - constexpr frequency::type, _Period> operator*(const _Rep1& __s, const frequency<_Rep2, _Period>& __d) - { - return __d * __s; - } - - template - constexpr frequency::value, _Rep2>::type>::type, _Period> operator/(const frequency<_Rep1, _Period>& __d, const _Rep2& __s) - { - typedef frequency::type, _Period> __cd; - return __cd(__cd(__d).count() / __s); - } - - template - constexpr typename common_type<_Rep1, _Rep2>::type operator/(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__lhs).count() / __cd(__rhs).count(); - } - - // DR 934. - template - constexpr frequency::value, _Rep2>::type>::type, _Period> operator%(const frequency<_Rep1, _Period>& __d, const _Rep2& __s) - { - typedef frequency::type, _Period> __cd; - return __cd(__cd(__d).count() % __s); - } - - template - constexpr typename common_type, frequency<_Rep2, _Period2>>::type operator%(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __cd; - return __cd(__cd(__lhs).count() % __cd(__rhs).count()); - } - - // comparisons - template - constexpr bool operator==(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __ct; - return __ct(__lhs).count() == __ct(__rhs).count(); - } - - template - constexpr bool operator<(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - typedef frequency<_Rep1, _Period1> __dur1; - typedef frequency<_Rep2, _Period2> __dur2; - typedef typename common_type<__dur1, __dur2>::type __ct; - return __ct(__lhs).count() < __ct(__rhs).count(); - } - - template - constexpr bool operator!=(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return !(__lhs == __rhs); - } - - template - constexpr bool operator<=(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return !(__rhs < __lhs); - } - - template - constexpr bool operator>(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return __rhs < __lhs; - } - - template - constexpr bool operator>=(const frequency<_Rep1, _Period1>& __lhs, const frequency<_Rep2, _Period2>& __rhs) - { - return !(__lhs < __rhs); - } - - using hertz = frequency; - using kilohertz = frequency; - using megahertz = frequency; - using gigahertz = frequency; - - constexpr hertz operator""_Hz(long double hz) { return hertz{hz}; } - constexpr hertz operator""_Hz(uint64_t hz) { return hertz{hz}; } - constexpr kilohertz operator""_kHz(long double kHz) { return kilohertz{kHz}; } - constexpr kilohertz operator""_kHz(uint64_t kHz) { return kilohertz{kHz}; } - constexpr megahertz operator""_MHz(long double MHz) { return megahertz{MHz}; } - constexpr megahertz operator""_MHz(uint64_t MHz) { return megahertz{MHz}; } - constexpr gigahertz operator""_GHz(long double GHz) { return gigahertz{GHz}; } - constexpr gigahertz operator""_GHz(uint64_t GHz) { return gigahertz{GHz}; } -} diff --git a/third-party/TeensyTimerTool/src/helpers.h b/third-party/TeensyTimerTool/src/helpers.h deleted file mode 100644 index 1a8a90f..0000000 --- a/third-party/TeensyTimerTool/src/helpers.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "config.h" -#include - -#if defined(USE_TIME_LITERALS) -#include -#endif - -namespace TeensyTimerTool -{ - //-------------------------------------------------------------- - // Transform arithmetic, period and frequency values to float - // For constant inputs the transformations are calculated at compile time - - // Arithmetic types - template ::value, int> * = nullptr> - float constexpr period2us(period_t v) - { - return (float)v; - } - -#if defined(USE_TIME_LITERALS) - - // Duration types (s, ms, ns...) - template ::value, int> * = nullptr> - float constexpr period2us(period_t v) - { - using namespace std::chrono; - return (duration_cast>(v).count()); - } - - -#endif - -} // namespace TeensyTimerTool \ No newline at end of file diff --git a/third-party/TeensyTimerTool/src/types.h b/third-party/TeensyTimerTool/src/types.h deleted file mode 100644 index 0cbe181..0000000 --- a/third-party/TeensyTimerTool/src/types.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once -#include "ErrorHandling/error_codes.h" -#include "config.h" -#include "Arduino.h" - -#if not defined(PLAIN_VANILLA_CALLBACKS) - -#include -inline void std::__throw_bad_function_call() -{ - while (1) {} // do whatever you want to do instead of an exception -} -namespace TeensyTimerTool -{ - using callback_t = std::function; - using errorFunc_t = std::function; - - extern void attachErrFunc(errorFunc_t); - extern errorCode postError(errorCode); -} // namespace TeensyTimerTool -#else -namespace TeensyTimerTool -{ - using callback_t = void (*)(); - using errorFunc_t = void (*)(errorCode); - - extern void attachErrFunc(errorFunc_t); - extern errorCode postError(errorCode); -} // namespace TeensyTimerTool -#endif - -#if defined(TTT_TEENSY4X) -#define TTT_F_CPU F_CPU_ACTUAL -#else -#define TTT_F_CPU F_CPU -#endif diff --git a/third-party/TeensyTimerTool/test/main.cpp b/third-party/TeensyTimerTool/test/main.cpp deleted file mode 100644 index 1a145de..0000000 --- a/third-party/TeensyTimerTool/test/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "Arduino.h" - -// General ============================================================================================= -//#include "../lib/TeensyTimerTool/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino" -//#include "../lib/TeensyTimerTool/examples/01_Basic/HelloOneShot/HelloOneShot.ino" -//#include "../lib/TeensyTimerTool/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino" -//#include "../lib/TeensyTimerTool/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino" -//#include "../lib/TeensyTimerTool/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino" -//#include "../lib/TeensyTimerTool/examples/02_Advanced/UsingLambdas/UsingLambdas.ino" - -//T3.x ================================================================================================ -//#include "../lib/TeensyTimerTool/examples/03_Applications/DoubleExposure/DoubleExposure.ino" - -//T4.x ================================================================================================ -//#include "../lib/TeensyTimerTool/examples/01_Basic/MoreTimers/MoreTimers.ino" -//#include "../lib/TeensyTimerTool/examples/01_Basic/RTC_Timer/RTC_Timer.ino" -//#include "../lib/TeensyTimerTool/examples/99_Misc/PinInformation/PinInformation.ino" diff --git a/third-party/to_test/static_malloc b/third-party/to_test/static_malloc deleted file mode 160000 index 526c3e7..0000000 --- a/third-party/to_test/static_malloc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 526c3e75aa2f23d1c51f6a5b443af6a2aac4955e