store that all buttons are negated

This commit is contained in:
Gordon Williams 2016-07-08 18:37:53 +01:00
parent c1b17f5b59
commit 334a822a53
2 changed files with 10 additions and 8 deletions

View File

@ -55,14 +55,14 @@ chip = {
};
devices = {
'LED1' : { 'pin' : 'D17' },
'LED2' : { 'pin' : 'D18' },
'LED3' : { 'pin' : 'D19' },
'LED4' : { 'pin' : 'D20' },
'BTN1' : { 'pin' : 'D13'},
'BTN2' : { 'pin' : 'D14'},
'BTN3' : { 'pin' : 'D15'},
'BTN4' : { 'pin' : 'D16'},
'LED1' : { 'pin' : 'D17', 'inverted' : True },
'LED2' : { 'pin' : 'D18', 'inverted' : True },
'LED3' : { 'pin' : 'D19', 'inverted' : True },
'LED4' : { 'pin' : 'D20', 'inverted' : True },
'BTN1' : { 'pin' : 'D13', 'inverted' : True },
'BTN2' : { 'pin' : 'D14', 'inverted' : True },
'BTN3' : { 'pin' : 'D15', 'inverted' : True },
'BTN4' : { 'pin' : 'D16', 'inverted' : True },
'RX_PIN_NUMBER' : { 'pin' : 'D8'},
'TX_PIN_NUMBER' : { 'pin' : 'D6'},
'CTS_PIN_NUMBER' : { 'pin' : 'D7'},

View File

@ -140,6 +140,8 @@ def codeOutDevice(device):
codeOut("#define "+device+"_ONSTATE "+("0" if "inverted" in board.devices[device] else "1"))
if "pinstate" in board.devices[device]:
codeOut("#define "+device+"_PINSTATE JSHPINSTATE_GPIO_"+board.devices[device]["pinstate"]);
if device[0:3]=="LED":
codeOut("#define "+device+"_ONSTATE "+("0" if "inverted" in board.devices[device] else "1"))
def codeOutDevicePin(device, pin, definition_name):
if device in board.devices: