* feature: Resetting the VFD works

* optimisation: made the code leaner
This commit is contained in:
2022-03-02 20:56:23 +01:00
parent f3bd6ecc00
commit 69c4eb43e0
3 changed files with 2 additions and 33 deletions

View File

@@ -44,25 +44,3 @@ void transmit_bytes (const uint8_t *payload, const uint8_t size)
_delay_us (DTCSH);
PORTB |= CSBpin;
}
void set_display_brightness (uint8_t level)
{
switch (level)
{
case 0:transmit_bytes (0x0A, 1);
break;
case 1:transmit_bytes (0x2A, 1);
break;
case 2:transmit_bytes (0x4A, 1);
break;
case 3:transmit_bytes (0x6A, 1);
break;
case 4:transmit_bytes (0x8A, 1);
break;
case 5:transmit_bytes (0xAA, 1);
break;
case 6:transmit_bytes (0xCA, 1);
default:transmit_bytes (0xEA, 1);
}
}

View File

@@ -19,7 +19,7 @@
/* -------------------------------------------------------------
* Innitial setup for the VFD controller interface
* Initial setup for the VFD controller interface
* Sets up the connected pins and leaves them in inactive state.
* ------------------------------------------------------------- */
void PT6302_startup(void);
@@ -32,11 +32,4 @@ void PT6302_startup(void);
void transmit_bytes (const uint8_t* payload, uint8_t size);
/* --------------------------------------------------------------
* Set the brightness of the VFD
* level can be between 0-7, 7 and larger will set max brightness
* It sets the display's duty cycle to conroll the brightness
* -------------------------------------------------------------- */
void set_display_brightness (uint8_t level);
#endif //_PT6302_H_

4
main.c
View File

@@ -6,10 +6,8 @@
int main ()
{
PT6302_startup ();
PT6302_startup();
while (1)
{
}
}