Update k3ng_keyer.ino

pull/118/head
Nico 2021-11-17 06:55:52 +01:00 zatwierdzone przez GitHub
rodzic 42f3b68425
commit 899973f525
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 52 dodań i 9 usunięć

Wyświetl plik

@ -1,10 +1,11 @@
/*
K3NG Arduino CW Keyer
Copyright 2010 - 2020 Anthony Good, K3NG
All trademarks referred to in source code and documentation are copyright their respective owners.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -1364,6 +1365,7 @@ If you offer a hardware kit using this software, show your appreciation by sendi
*/
#define CODE_VERSION "2021.07.17.01"
#define eeprom_magic_number 41 // you can change this number to have the unit re-initialize EEPROM
@ -1577,6 +1579,12 @@ If you offer a hardware kit using this software, show your appreciation by sendi
#define WIRECLOCK 400000L
#endif
#if defined(FEATURE_OLED_SSD1306)
#include <Wire.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
#endif
#if defined(FEATURE_TRAINING_COMMAND_LINE_INTERFACE)
// #include <BasicTerm.h>
#endif
@ -2011,6 +2019,10 @@ byte send_buffer_status = SERIAL_SEND_BUFFER_NORMAL;
hd44780_I2Cexp lcd;
#endif
#if defined(FEATURE_OLED_SSD1306)
SSD1306AsciiWire lcd;
#endif
#if defined(FEATURE_USB_KEYBOARD) || defined(FEATURE_USB_MOUSE)
USB Usb;
uint32_t next_time;
@ -3541,7 +3553,11 @@ void service_display() {
return;
} else {
x = 0;
#ifndef FEATURE_OLED_SSD1306
lcd.setCursor(0,y);
#else
lcd.setCursor(0,y*2);
#endif;
}
} else {
if (lcd_scroll_buffer[y].charAt(x) > 0){
@ -3689,8 +3705,10 @@ void display_scroll_print_char(char charin){
#ifdef FEATURE_DISPLAY
void lcd_clear() {
lcd.clear();
#ifndef FEATURE_OLED_SSD1306
lcd.noCursor();//sp5iou 20180328
lcd_status = LCD_CLEAR;
#endif
lcd_status = LCD_CLEAR;
}
#endif
@ -3701,7 +3719,10 @@ void lcd_center_print_timed(String lcd_print_string, byte row_number, unsigned i
#ifdef FEATURE_LCD_BACKLIGHT_AUTO_DIM
lcd.backlight();
#endif //FEATURE_LCD_BACKLIGHT_AUTO_DIM
#ifndef FEATURE_OLED_SSD1306
lcd.noCursor();//sp5iou 20180328
#endif
if (lcd_status != LCD_TIMED_MESSAGE) {
lcd_previous_status = lcd_status;
lcd_status = LCD_TIMED_MESSAGE;
@ -3709,7 +3730,14 @@ void lcd_center_print_timed(String lcd_print_string, byte row_number, unsigned i
} else {
clear_display_row(row_number);
}
lcd.setCursor(((LCD_COLUMNS - lcd_print_string.length())/2),row_number);
#ifndef FEATURE_OLED_SSD1306
lcd.setCursor(((LCD_COLUMNS - lcd_print_string.length())/2),row_number);
#else
if (lcd_print_string.length() <= LCD_COLUMNS )
lcd.setCursor(((LCD_COLUMNS - lcd_print_string.length())/2)*11,2*row_number);
else
lcd.setCursor(0,2*row_number);
#endif
lcd.print(lcd_print_string);
lcd_timed_message_clear_time = millis() + duration;
}
@ -3723,9 +3751,15 @@ void clear_display_row(byte row_number)
#ifdef FEATURE_LCD_BACKLIGHT_AUTO_DIM
lcd.backlight();
#endif //FEATURE_LCD_BACKLIGHT_AUTO_DIM
#ifndef FEATURE_OLED_SSD1306
lcd.noCursor();//sp5iou 20180328
#endif
for (byte x = 0; x < LCD_COLUMNS; x++) {
#ifndef FEATURE_OLED_SSD1306
lcd.setCursor(x,row_number);
#else
lcd.setCursor(x*11,row_number*2);
#endif
lcd.print(" ");
}
}
@ -18260,13 +18294,22 @@ void ps2int_write() {
void initialize_display(){
#ifdef FEATURE_DISPLAY
#if defined(FEATURE_LCD_SAINSMART_I2C) || defined(FEATURE_LCD_I2C_FDEBRABANDER)
lcd.begin();
lcd.home();
#ifdef FEATURE_DISPLAY
#ifdef FEATURE_OLED_SSD1306
Wire.begin();
Wire.setClock(400000L);
lcd.begin(&Adafruit128x64, oled_i2c_address_ssd1306);
lcd.setFont(fixed_bold10x15);
#else
lcd.begin(LCD_COLUMNS, LCD_ROWS);
#if defined(FEATURE_LCD_SAINSMART_I2C) || defined(FEATURE_LCD_I2C_FDEBRABANDER)
lcd.begin();
lcd.home();
#else
lcd.begin(LCD_COLUMNS, LCD_ROWS);
#endif
#endif
#ifdef FEATURE_LCD_ADAFRUIT_I2C
lcd.setBacklight(lcdcolor);
#endif //FEATURE_LCD_ADAFRUIT_I2C
@ -18277,7 +18320,7 @@ void initialize_display(){
#ifdef FEATURE_LCD_MATHERTEL_PCF8574
lcd.setBacklight(HIGH);
#endif
#ifdef OPTION_DISPLAY_NON_ENGLISH_EXTENSIONS // OZ1JHM provided code, cleaned up by LA3ZA
// Store bit maps, designed using editor at http://omerk.github.io/lcdchargen/