summaryrefslogtreecommitdiff
path: root/keyboards/cluepad/backlight.c
diff options
context:
space:
mode:
authorChristopher Browne <cbbrowne@ca.afilias.info>2016-06-30 12:38:48 -0400
committerChristopher Browne <cbbrowne@ca.afilias.info>2016-06-30 12:38:48 -0400
commit44a5f7630f18b40b36270d49449a43cd42b802f0 (patch)
tree9d29ee26496a458bf161eeb59dab5e12d85cb3aa /keyboards/cluepad/backlight.c
parentc9f509f0168f6d11e743a9d2e37964c05e45672b (diff)
parenta8b55f8c858933a0f7641f7bf2dede640235aa70 (diff)
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'keyboards/cluepad/backlight.c')
-rw-r--r--keyboards/cluepad/backlight.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/keyboards/cluepad/backlight.c b/keyboards/cluepad/backlight.c
deleted file mode 100644
index a9caed1df8..0000000000
--- a/keyboards/cluepad/backlight.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <avr/io.h>
-#include "backlight.h"
-#include "led.h"
-
-#include "print.h"
-
-int pwm_level;
-
-void led_set_kb(uint8_t usb_led)
-{
- print("led_set\n");
-}
-
-void init_backlight_pin(void)
-{
- // Set C7 to output
- DDRC |= (1<<7);
-
- // Initialize the timer
- TC4H = 0x03;
- OCR4C = 0xFF;
- TCCR4A = 0b10000010;
- TCCR4B = 0b00000001;
-}
-
-void backlight_set(uint8_t level)
-{
- // Determine the PWM level
- switch (level)
- {
- case 0:
- // 33%
- pwm_level = 0x54;
- break;
- case 1:
- // 66%
- pwm_level = 0xA8;
- break;
- case 2:
- // 100%
- pwm_level = 0xFF;
- break;
- case 3:
- // 0%
- pwm_level = 0x00;
- break;
- default:
- xprintf("Unknown level: %d\n", level);
- }
-
- // Write the PWM level to the timer
- TC4H = pwm_level >> 8;
- OCR4A = 0xFF & pwm_level;
-}