mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
BCD cleanup
Combine multiple BCD implementations. Signed-off-by: Paul Brook <paul@codesourcery.com>
This commit is contained in:
parent
a992fe3d0f
commit
abd0c6bda0
5 changed files with 79 additions and 98 deletions
|
@ -183,16 +183,6 @@ static void menelaus_reset(i2c_slave *i2c)
|
|||
menelaus_update(s);
|
||||
}
|
||||
|
||||
static inline uint8_t to_bcd(int val)
|
||||
{
|
||||
return ((val / 10) << 4) | (val % 10);
|
||||
}
|
||||
|
||||
static inline int from_bcd(uint8_t val)
|
||||
{
|
||||
return ((val >> 4) * 10) + (val & 0x0f);
|
||||
}
|
||||
|
||||
static void menelaus_gpio_set(void *opaque, int line, int level)
|
||||
{
|
||||
MenelausState *s = (MenelausState *) opaque;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue