Skip to content

Commit 5c6ee61

Browse files
Remove const specifier from channelToTC array in analogWrite on SAM
Members of this array are later passed to functions that accept non-const pointers. These functions probably don't modify their arguments, so a better solution would be to update those functions to accept const pointers. However, they look like third-party code, so that would require changing the code again on every update. Removing const here fixes at least the compiler warning for now. This helps towards #1792.
1 parent 4b3db72 commit 5c6ee61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: hardware/arduino/sam/cores/arduino/wiring_analog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ void analogWrite(uint32_t ulPin, uint32_t ulValue) {
293293
ETCChannel channel = g_APinDescription[ulPin].ulTCChannel;
294294
static const uint32_t channelToChNo[] = { 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2 };
295295
static const uint32_t channelToAB[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 };
296-
static const Tc *channelToTC[] = {
296+
static Tc *channelToTC[] = {
297297
TC0, TC0, TC0, TC0, TC0, TC0,
298298
TC1, TC1, TC1, TC1, TC1, TC1,
299299
TC2, TC2, TC2, TC2, TC2, TC2 };

0 commit comments

Comments
 (0)