Skip to content

Commit 410e96b

Browse files
authored
Merge pull request #10823 from OpenNuvoton/nuvoton_fix_dac
Nuvoton: Fix channel release in analogout_free()
2 parents 3e6f5eb + 016ab2a commit 410e96b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/analogout_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void analogout_free(dac_t *obj)
124124
/* Channel-level windup from here */
125125

126126
/* Mark channel free */
127-
dac_modinit_mask[modidx] &= ~(1 << modidx);
127+
dac_modinit_mask[modidx] &= ~(1 << chn);
128128

129129
/* Close channel */
130130
DAC_Close(dac_base, chn);

targets/TARGET_NUVOTON/TARGET_M451/analogout_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void analogout_free(dac_t *obj)
106106
/* Channel-level windup from here */
107107

108108
/* Mark channel free */
109-
dac_modinit_mask[modidx] &= ~(1 << modidx);
109+
dac_modinit_mask[modidx] &= ~(1 << chn);
110110

111111
/* Close channel */
112112
DAC_Close(dac_base, chn);

targets/TARGET_NUVOTON/TARGET_M480/analogout_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void analogout_free(dac_t *obj)
115115
/* Channel-level windup from here */
116116

117117
/* Mark channel free */
118-
dac_modinit_mask[modidx] &= ~(1 << modidx);
118+
dac_modinit_mask[modidx] &= ~(1 << chn);
119119

120120
/* Close channel */
121121
DAC_Close(dac_base, chn);

targets/TARGET_NUVOTON/TARGET_NANO100/analogout_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void analogout_free(dac_t *obj)
110110
/* Channel-level windup from here */
111111

112112
/* Mark channel free */
113-
dac_modinit_mask[modidx] &= ~(1 << modidx);
113+
dac_modinit_mask[modidx] &= ~(1 << chn);
114114

115115
/* Close channel */
116116
DAC_Close(dac_base, chn);

0 commit comments

Comments
 (0)