Added wordmap and remove wordclock module.
This commit is contained in:
@@ -117,18 +117,33 @@ class LEDMatrix
|
||||
|
||||
void clear(void);
|
||||
|
||||
BaseType_t tick(void);
|
||||
|
||||
private:
|
||||
|
||||
LEDMatrix_Parameters_t parameters;
|
||||
LEDMatrix_Pixel_t* matrix;
|
||||
uint8_t* tx_matrix;
|
||||
unsigned int numberOfPixels;
|
||||
|
||||
static bool initialized;
|
||||
static TaskHandle_t matrixTaskHandle;
|
||||
static SemaphoreHandle_t taskSemaphore;
|
||||
static void matrixTask(void* parameters);
|
||||
};
|
||||
|
||||
|
||||
inline BaseType_t LEDMatrix::tick(void)
|
||||
{
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
if (LEDMatrix::initialized)
|
||||
{
|
||||
xSemaphoreGiveFromISR(LEDMatrix::taskSemaphore, &xHigherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
return xHigherPriorityTaskWoken;
|
||||
}
|
||||
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
/// \file wordclock.h
|
||||
/// \brief File description
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// vbchaos software design
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
/// $Revision: $
|
||||
/// $Author: $
|
||||
/// $Date: $
|
||||
// (c) 2023 vbchaos
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef MAIN_INC_WORDCLOCK_H_
|
||||
#define MAIN_INC_WORDCLOCK_H_
|
||||
|
||||
/**
|
||||
* wordclock implementation
|
||||
* \defgroup wordclock
|
||||
* \brief {group_description}
|
||||
* \addtogroup {Layer}
|
||||
*
|
||||
* Detailed description
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Include files
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// CompilerIncludes
|
||||
// All include files that are provided by the compiler directly
|
||||
|
||||
|
||||
|
||||
// ProjectIncludes
|
||||
// All include files that are provided by the project
|
||||
#include "ledmatrix.h"
|
||||
#include "clock.h"
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
class Wordclock
|
||||
{
|
||||
public:
|
||||
enum language
|
||||
{
|
||||
NL = 0,
|
||||
EN,
|
||||
NumberOfLanguages
|
||||
};
|
||||
|
||||
Wordclock(LEDMatrix* matrix);
|
||||
|
||||
void update(Clock::TimeStructure* timestructure);
|
||||
|
||||
private:
|
||||
|
||||
LEDMatrix* matrix;
|
||||
language language;
|
||||
|
||||
struct word
|
||||
{
|
||||
LEDMatrix::coordinate position;
|
||||
int length;
|
||||
};
|
||||
|
||||
struct wordmap
|
||||
{
|
||||
struct word prefix;
|
||||
struct word prefix_additional;
|
||||
struct word almost;
|
||||
struct word five;
|
||||
struct word ten;
|
||||
struct word quarter;
|
||||
struct word before;
|
||||
struct word after;
|
||||
struct word half;
|
||||
struct word hour[12];
|
||||
struct word hourPostfix;
|
||||
|
||||
};
|
||||
|
||||
struct wordmap languagemaps[NumberOfLanguages]
|
||||
{
|
||||
{
|
||||
// prefix
|
||||
{0,0,3}, {4,0,2},
|
||||
// almost
|
||||
{0,0,0},
|
||||
// five/ten/quarter
|
||||
{7,0,4}, {0,1,4}, {6,2,5},
|
||||
// before/after
|
||||
{7,1,4}, {0,2,4},
|
||||
// {0,4,4}, {7,3,4},
|
||||
// half
|
||||
{0,3,4},
|
||||
// hours
|
||||
{{7,4,3},{0,5,4},{7,5,4},{0,6,4},{4,6,4},{6,8,3},{0,7,5},{0,8,4},{6,7,5},{4,8,4},{8,8,3},{0,9,6}},
|
||||
// hour postfix
|
||||
{8,9,3}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* MAIN_INC_WORDCLOCK_H_ */
|
||||
Reference in New Issue
Block a user