From 50ea86fe8b95ec8ce091061c34f449773ebe216a Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 22 Feb 2015 22:32:04 +0000 Subject: [PATCH] stmhal: For pins, define macros mapping board names to cpu names. --- stmhal/boards/make-pins.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stmhal/boards/make-pins.py b/stmhal/boards/make-pins.py index 44da266ae1..afb594e412 100755 --- a/stmhal/boards/make-pins.py +++ b/stmhal/boards/make-pins.py @@ -282,6 +282,9 @@ class Pins(object): hdr_file.write('extern const pin_obj_t * const pin_adc1[];\n') hdr_file.write('extern const pin_obj_t * const pin_adc2[];\n') hdr_file.write('extern const pin_obj_t * const pin_adc3[];\n') + # provide #define's mapping board to cpu name + for named_pin in self.board_pins: + hdr_file.write("#define pyb_pin_{:s} pin_{:s}\n".format(named_pin.name(), named_pin.pin().cpu_pin_name())) def print_qstr(self, qstr_filename): with open(qstr_filename, 'wt') as qstr_file: