Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new language D3 Deutsch (schwäbische Mundart) #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Selten gebrauchte externe Modi einschalten
*/
// Datumanzeige
//#define USE_STD_MODE_DATE
//#define USE_STD_MODE_DATE
// Anzeige der vergangenen Stunden und Minuten seit der letzten erfolgreichen DCF-Synchronisation im Menü EXT_MODE_DCF_DEBUG (Standard: eingeschaltet).
#define USE_EXT_MODE_DCF_SYNC
// Einstellmöglichkeit Minuten LEDs im/gegen Uhrzeigersinn
Expand All @@ -48,14 +48,15 @@
//#define ENABLE_LANGUAGE_IT
//#define ENABLE_LANGUAGE_NL
//#define ENABLE_LANGUAGE_ES
#define ENABLE_LANGUAGE_D3

/*
* Zusätzliche Schalter, um neue Zusatzfunktionen ein- bzw. auszuschalten.
*/
// Automatischer Rücksprung von STD_MODE_BLANK, wenn DCF-Synchronisation erfolgreich war (Standard: eingeschaltet).
#define AUTO_JUMP_BLANK

// Automatischer Rücksprung von Abschalt-/Einschaltzeit zu EXT_MODE_NIGHT_OFF/EXT_MODE_NIGHT_ON
// Automatischer Rücksprung von Abschalt-/Einschaltzeit zu EXT_MODE_NIGHT_OFF/EXT_MODE_NIGHT_ON
#define FALL_BACK_TIME_NIGHT_MODE 5

// Schaltet für jede Eckled und das Alarmsymbol (Glockensymbol) nur die dazu passende Kathode und
Expand Down Expand Up @@ -94,32 +95,32 @@
/*
* Welches Board wird benutzt? Wird aktuell nur für das Pinmapping von LPD8806 und Neopixel gebraucht
*/
#define BOARD_DEFAULT
//#define BOARD_CLT
//#define BOARD_DEFAULT
#define BOARD_CLT
//#define BOARD_BBRTCAD
//#define BOARD_AMBBRTCAD

/*
* Welcher LED-Treiber soll benutzt werden?
*/
#define LED_DRIVER_DEFAULT
// #define LED_DRIVER_DEFAULT
// #define LED_DRIVER_UEBERPIXEL
// #define LED_DRIVER_POWER_SHIFT_REGISTER
// #define LED_DRIVER_NEOPIXEL
// #define LED_DRIVER_DOTSTAR
// #define LED_DRIVER_LPD8806
#define LED_DRIVER_LPD8806

/*
* wenn LED_DRIVER_DEFAULT dann normalerweise Hardware mit UDN,
* wenn Hardware mit einzelnen FETs dann MODS_DRIVER setzen
*/
#ifdef LED_DRIVER_DEFAULT
//#define MOS_DRIVER
//#define MOS_DRIVER
#endif

#if defined(LED_DRIVER_LPD8806) || defined(LED_DRIVER_NEOPIXEL)
#define RGB_LEDS
//#define RGBW_LEDS
//#define RGB_LEDS
#define RGBW_LEDS
//#define MATRIX_XXL
#endif

Expand All @@ -137,9 +138,9 @@
//#define TEMP_SENS_LM335

#ifndef TEMP_SENS_NONE
// Temperaturanzeige
#define USE_STD_MODE_TEMP
#endif
// Temperaturanzeige
#define USE_STD_MODE_TEMP
#endif

/*
* Welche IR-Fernbedienung soll benutzt werden?
Expand Down
10 changes: 8 additions & 2 deletions Qlockthree.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

@mc Arduino/RBBB (ATMEGA328)
@autor Christian Aschoff / caschoff _AT_ mac _DOT_ com
@version 3.4.8
@version 3.4.9
@created 1.11.2011
@updated 15.3.2015
@updated 03.04.2018

Versionshistorie:
V 1.1: - DCF77 auf reine Zeit ohne Strings umgestellt.
Expand Down Expand Up @@ -162,6 +162,7 @@
- Unterstuetzung fuer die alte Arduino-IDE (bis 1.0.6) entfernt, da sich die Firmware damit eh nicht mehr kompilieren laesst.
- Library fuer MAX7219 (LedControl) ausgelagert, sie muss jetzt im Librarys-Ordner liegen.
V 3.4.8. - HelperSeconds-Behandlung in Interrupt-Funktion verschoben, damit die nicht aufgrund von Tastendruecken hochgezaehlt werden, danke an Meikel.
V 3.4.9. - Schwaebisch (D3) hinzugefügt
*/
#include <Wire.h> // Wire library fuer I2C
#include <avr/pgmspace.h>
Expand Down Expand Up @@ -1289,6 +1290,11 @@ void loop() {
case LANGUAGE_ES:
renderer.setMenuText("ES", Renderer::TEXT_POS_MIDDLE, matrix);
break;
#endif
#ifdef ENABLE_LANGUAGE_D3
case LANGUAGE_D3:
renderer.setMenuText("D3", Renderer::TEXT_POS_MIDDLE, matrix);
break;
#endif
default:
;
Expand Down
145 changes: 145 additions & 0 deletions Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "Woerter_IT.h"
#include "Woerter_NL.h"
#include "Woerter_ES.h"
#include "Woerter_D3.h"
#include "Staben.h"
#include "Zahlen.h"

Expand Down Expand Up @@ -723,6 +724,87 @@ void Renderer::setMinutes(char hours, byte minutes, byte language, word matrix[1
break;
}
break;
#endif
#ifdef ENABLE_LANGUAGE_D3
//
// Schwaebisch (D3)
//
case LANGUAGE_D3:
D3_ESISCH;
switch (minutes / 5) {
case 0:
// glatte Stunde
setHours(hours, true, language, matrix);
break;
case 1:
// 5 nach
D3_FUENF;
D3_NACH;
setHours(hours, false, language, matrix);
break;
case 2:
// 10 nach
D3_ZEHN;
D3_NACH;
setHours(hours, false, language, matrix);
break;
case 3:
// viertl nach
D3_VIERTL;
setHours(hours + 1, false, language, matrix);
break;
case 4:
// 10 vor halb
D3_ZEHN;
D3_VOR;
D3_HALB;
setHours(hours + 1, false, language, matrix);
break;
case 5:
// 5 vor halb
D3_FUENF;
D3_VOR;
D3_HALB;
setHours(hours + 1, false, language, matrix);
break;
case 6:
// halb
D3_HALB;
setHours(hours + 1, false, language, matrix);
break;
case 7:
// 5 nach halb
D3_FUENF;
D3_NACH;
D3_HALB;
setHours(hours + 1, false, language, matrix);
break;
case 8:
// 10 nach halb
D3_ZEHN;
D3_NACH;
D3_HALB;
setHours(hours + 1, false, language, matrix);
break;
case 9:
// viertel vor
D3_DREIVIERTL;
setHours(hours + 1, false, language, matrix);
break;
case 10:
// 10 vor
D3_ZEHN;
D3_VOR;
setHours(hours + 1, false, language, matrix);
break;
case 11:
// 5 vor
D3_FUENF;
D3_VOR;
setHours(hours + 1, false, language, matrix);
break;
}
break;
#endif
default:
;
Expand Down Expand Up @@ -1168,6 +1250,64 @@ void Renderer::setHours(byte hours, boolean glatt, byte language, word matrix[16
break;
}
break;
#endif
#ifdef ENABLE_LANGUAGE_D3
//
// Schwaebisch (D3)
//
case LANGUAGE_D3:
switch (hours) {
case 0:
case 12:
case 24:
D3_H_ZWOELFE;
break;
case 1:
case 13:
D3_H_OISE;
break;
case 2:
case 14:
D3_H_ZWOIE;
break;
case 3:
case 15:
D3_H_DREIE;
break;
case 4:
case 16:
D3_H_VIERE;
break;
case 5:
case 17:
D3_H_FUENFE;
break;
case 6:
case 18:
D3_H_SECHSE;
break;
case 7:
case 19:
D3_H_SIEBNE;
break;
case 8:
case 20:
D3_H_ACHTE;
break;
case 9:
case 21:
D3_H_NEUNE;
break;
case 10:
case 22:
D3_H_ZEHNE;
break;
case 11:
case 23:
D3_H_ELFE;
break;
}
break;
#endif
default:
;
Expand Down Expand Up @@ -1252,6 +1392,11 @@ void Renderer::cleanWordsForAlarmSettingMode(byte language, word matrix[16]) {
matrix[0] &= 0b1000100011111111; // SON LAS weg
matrix[0] &= 0b0011100111111111; // ES LA weg
break;
#endif
#ifdef ENABLE_LANGUAGE__D3
case LANGUAGE_D3:
matrix[0] &= 0b0010000111111111; // ES ISCH weg
break;
#endif
default:
;
Expand Down
3 changes: 3 additions & 0 deletions Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ enum eLanguage : byte{
#endif
#ifdef ENABLE_LANGUAGE_ES
LANGUAGE_ES,
#endif
#ifdef ENABLE_LANGUAGE_D3
LANGUAGE_D3,
#endif
LANGUAGE_COUNT,
};
Expand Down
6 changes: 3 additions & 3 deletions Staben.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ const char stabenBig[][8] PROGMEM = {
{0x04, 0x0f, 0x14, 0x0e, 0x05, 0x1e, 0x04, 0}, // ASCII-Code 0x24 => $ (36)
{0x18, 0x19, 0x02, 0x04, 0x08, 0x13, 0x03, 0}, // ASCII-Code 0x25 => % (37)
{0x0c, 0x12, 0x14, 0x08, 0x15, 0x12, 0x0d, 0}, // ASCII-Code 0x26 => & (38)
{0x18, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 3}, // ASCII-Code 0x27 => ? (39)
{0x04, 0x08, 0x10, 0x10, 0x10, 0x08, 0x04, 2}, // ASCII-Code 0x28 => { (40)
{0x10, 0x08, 0x04, 0x04, 0x04, 0x08, 0x10, 2}, // ASCII-Code 0x29 => } (41)
{0x18, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 3}, // ASCII-Code 0x27 => ' (39)
{0x04, 0x08, 0x10, 0x10, 0x10, 0x08, 0x04, 2}, // ASCII-Code 0x28 => ( (40)
{0x10, 0x08, 0x04, 0x04, 0x04, 0x08, 0x10, 2}, // ASCII-Code 0x29 => ) (41)
{0x00, 0x04, 0x15, 0x0e, 0x15, 0x04, 0x00, 0}, // ASCII-Code 0x2A => * (42)
{0x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00, 0}, // ASCII-Code 0x2B => + (43)
{0x00, 0x00, 0x00, 0x00, 0x18, 0x08, 0x10, 3}, // ASCII-Code 0x2C => , (44)
Expand Down
52 changes: 52 additions & 0 deletions Woerter_D3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Woerter_D3
* Definition der schwaebischen Woerter fuer die Zeitansage.
* Die Woerter sind Bitmasken fuer die Matrix.
*
* 01234567890
* 0 ESKISCHFUNK
* 1 DREIVIERTLA
* 2 ZEHNBIEFUNF
* 3 NACHGERTVOR
* 4 HALBXFUNFEI
* 5 OISECHSELFE
* 6 ZWOIEACHTED
* 7 DREIEZWOLFE
* 8 ZEHNEUNEUHL
* 9 SIEBNEVIERE
*
* @mc Arduino/RBBB
* @autor Fisch0204 & Chriophs007 (Unter Vorlage von Christian Aschoff)
* @version 1.0
* @created 03.03.2016
*/
#ifndef WOERTER_D3_H
#define WOERTER_D3_H

/**
* Definition der Woerter
*/
#define D3_ESISCH matrix[0] |= 0b1101111000000000
#define D3_VOR matrix[3] |= 0b0000000011100000
#define D3_NACH matrix[3] |= 0b1111000000000000

#define D3_FUENF matrix[2] |= 0b0000000111100000
#define D3_ZEHN matrix[2] |= 0b1111000000000000
#define D3_VIERTL matrix[1] |= 0b0000111111000000
#define D3_HALB matrix[4] |= 0b1111000000000000
#define D3_DREIVIERTL matrix[1] |= 0b1111111111000000

#define D3_H_OISE matrix[5] |= 0b1111000000000000
#define D3_H_ZWOIE matrix[6] |= 0b1111100000000000
#define D3_H_DREIE matrix[7] |= 0b1111100000000000
#define D3_H_VIERE matrix[9] |= 0b0000001111100000
#define D3_H_FUENFE matrix[4] |= 0b0000011111000000
#define D3_H_SECHSE matrix[5] |= 0b0011111100000000
#define D3_H_SIEBNE matrix[9] |= 0b1111110000000000
#define D3_H_ACHTE matrix[6] |= 0b0000011111000000
#define D3_H_NEUNE matrix[8] |= 0b0001111100000000
#define D3_H_ZEHNE matrix[8] |= 0b1111100000000000
#define D3_H_ELFE matrix[5] |= 0b0000000111100000
#define D3_H_ZWOELFE matrix[7] |= 0b0000011111100000

#endif