Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/AppRegsImpl.tt
Original file line number Diff line number Diff line change
Expand Up @@ -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 #>;
<#
}
#>
Expand Down
2 changes: 2 additions & 0 deletions tests/ExpectedOutput/device.app_ios_and_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -54,6 +55,7 @@ void init_ios(void)
clr_POKE1_VALVE;
clr_POKE2_LED;
clr_POKE2_VALVE;
set_CS0_1;
}

/************************************************************************/
Expand Down
7 changes: 7 additions & 0 deletions tests/ExpectedOutput/device.app_ios_and_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 */
/************************************************************************/
Expand Down
8 changes: 8 additions & 0 deletions tests/Metadata/device.ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading