diff --git a/src/AppRegsImpl.tt b/src/AppRegsImpl.tt index 4a9ef85..1c4df39 100644 --- a/src/AppRegsImpl.tt +++ b/src/AppRegsImpl.tt @@ -109,8 +109,9 @@ if (outputPins.Count > 0) foreach (var pin in outputPins) { var pinName = FirmwareNamingConvention.Instance.Apply(pin.Key); + var pinState = pin.Value.InitialState > 0 ? "set" : "clr"; #> - clr_<#= pinName #>; + <#= pinState #>_<#= pinName #>; <# } #> diff --git a/tests/ExpectedOutput/device.app_ios_and_regs.c b/tests/ExpectedOutput/device.app_ios_and_regs.c index 25e3000..0f4f06d 100644 --- a/tests/ExpectedOutput/device.app_ios_and_regs.c +++ b/tests/ExpectedOutput/device.app_ios_and_regs.c @@ -39,6 +39,7 @@ void init_ios(void) io_pin2out(&PORTE, 7, OUT_IO_DIGITAL, IN_EN_IO_EN); // POKE1_VALVE io_pin2out(&PORTF, 6, OUT_IO_DIGITAL, IN_EN_IO_EN); // POKE2_LED io_pin2out(&PORTF, 7, OUT_IO_DIGITAL, IN_EN_IO_EN); // POKE2_VALVE + io_pin2out(&PORTC, 0, OUT_IO_WIREDAND, IN_EN_IO_EN); // CS0_1 /* Initialize output pins */ clr_DO3; @@ -54,6 +55,7 @@ void init_ios(void) clr_POKE1_VALVE; clr_POKE2_LED; clr_POKE2_VALVE; + set_CS0_1; } /************************************************************************/ diff --git a/tests/ExpectedOutput/device.app_ios_and_regs.h b/tests/ExpectedOutput/device.app_ios_and_regs.h index f70e0c3..a2e61ac 100644 --- a/tests/ExpectedOutput/device.app_ios_and_regs.h +++ b/tests/ExpectedOutput/device.app_ios_and_regs.h @@ -40,6 +40,7 @@ void init_ios(void); // POKE1_VALVE Description: Poke 1 Valve // POKE2_LED Description: Poke 2 digital output // POKE2_VALVE Description: Poke 2 Valve +// CS0_1 Description: CS0_1 / CS_ADC0 /* DO3 */ #define set_DO3 set_io(PORTC, 0) @@ -119,6 +120,12 @@ void init_ios(void); #define tgl_POKE2_VALVE toggle_io(PORTF, 7) #define read_POKE2_VALVE read_io(PORTF, 7) +/* CS0_1 */ +#define set_CS0_1 set_io(PORTC, 0) +#define clr_CS0_1 clear_io(PORTC, 0) +#define tgl_CS0_1 toggle_io(PORTC, 0) +#define read_CS0_1 read_io(PORTC, 0) + /************************************************************************/ /* Registers' structure */ /************************************************************************/ diff --git a/tests/Metadata/device.ios.yml b/tests/Metadata/device.ios.yml index 1cabdf6..061b8b2 100644 --- a/tests/Metadata/device.ios.yml +++ b/tests/Metadata/device.ios.yml @@ -164,3 +164,11 @@ DI3: interruptPriority: low interruptNumber: 0 description: Input DI3 +CS0_1: + port: PORTC + pinNumber: 0 + direction: output + allowRead: true + pinMode: wiredAnd + initialState: high + description: CS0_1 / CS_ADC0