mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
store that all buttons are negated
This commit is contained in:
parent
c1b17f5b59
commit
334a822a53
@ -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'},
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user