clipv2: make buttonlight functions static inline one-liners
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26323 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3cb30cb513
commit
065ef89479
2 changed files with 18 additions and 15 deletions
|
@ -35,15 +35,3 @@ void _backlight_off(void)
|
|||
lcd_enable(false);
|
||||
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0);
|
||||
}
|
||||
|
||||
void _buttonlight_on(void)
|
||||
{
|
||||
GPIOA_DIR |= (1<<5);
|
||||
GPIOA_PIN(5) = (1<<5); /* set pin a5 high */
|
||||
}
|
||||
|
||||
void _buttonlight_off(void)
|
||||
{
|
||||
GPIOA_DIR |= (1<<5);
|
||||
GPIOA_PIN(5) = 0; /* set pin a5 low */
|
||||
}
|
||||
|
|
|
@ -21,12 +21,27 @@
|
|||
#ifndef BACKLIGHT_TARGET_H
|
||||
#define BACKLIGHT_TARGET_H
|
||||
|
||||
#define _backlight_init() true
|
||||
#include <stdbool.h>
|
||||
#include "cpu.h"
|
||||
|
||||
void _backlight_on(void);
|
||||
void _backlight_off(void);
|
||||
|
||||
void _buttonlight_on(void);
|
||||
void _buttonlight_off(void);
|
||||
static inline bool _backlight_init(void)
|
||||
{
|
||||
GPIOA_DIR |= 1<<5; /* for button light */
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void _buttonlight_on(void)
|
||||
{
|
||||
GPIOA_PIN(5) |= 1<<5;
|
||||
}
|
||||
|
||||
static inline void _buttonlight_off(void)
|
||||
{
|
||||
GPIOA_PIN(5) &= ~(1<<5);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue