Compare commits

..

No commits in common. "8fec7fbc8b64817abe63b23a44e51485050ad805" and "577ba83a586ceef83e689a19639deee90cb5ef62" have entirely different histories.

2 changed files with 5 additions and 12 deletions

View File

@ -10,7 +10,7 @@ static volatile uint8_t sw_event = 0;
void input_init()
{
PORT_ROTARY(DDR) &= ~(PIN_ROTARY_A | PIN_ROTARY_B); // Configure as input
PORT_ROTARY(PORT) |= (PIN_ROTARY_A | PIN_ROTARY_B); // Set pullups
PORT_ROTARY(PORT) &= ~(PIN_ROTARY_A | PIN_ROTARY_B); // Set pullups
PORT_KEYPAD(DDR) &= ~(PIN_KEYPAD_MASK); // Key inputs
PORT_KEYPAD(PORT) |= PIN_KEYPAD_MASK; // Key pullups

View File

@ -150,17 +150,10 @@ class radioserv:
elif (key_id == 7): # PRESET
pass
# Handle rotary input
rotary_delta = int(rdata[1])
if (rotary_delta > 127):
rotary_delta -= 256
if (rotary_delta != 0):
print("Rotary: {}".format(rotary_delta))
nvol = int(self.mpd.status()['volume']) + (rotary_delta * 4)
if (nvol < 0):
nvol = 0;
elif (nvol > 100):
nvol = 100
self.mpd.setvol(nvol)
rotary_delta = int(rdata[1])# - 128
if (rotary_delta > 0):
print("Rotary: {}".format(rdata[2]))
# self.mpd.volume(rotary_delta)
#print("Battery: {}".format(rdata[2]))
async def io_main(self):