From 5c6ee6127cbfd2df34357328fc5b687489ffc3ef Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 18 Feb 2014 21:04:31 +0100 Subject: [PATCH] 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. --- hardware/arduino/sam/cores/arduino/wiring_analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/sam/cores/arduino/wiring_analog.c b/hardware/arduino/sam/cores/arduino/wiring_analog.c index 2afa0c9e7..1385f01eb 100644 --- a/hardware/arduino/sam/cores/arduino/wiring_analog.c +++ b/hardware/arduino/sam/cores/arduino/wiring_analog.c @@ -293,7 +293,7 @@ void analogWrite(uint32_t ulPin, uint32_t ulValue) { ETCChannel channel = g_APinDescription[ulPin].ulTCChannel; static const uint32_t channelToChNo[] = { 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2 }; static const uint32_t channelToAB[] = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }; - static const Tc *channelToTC[] = { + static Tc *channelToTC[] = { TC0, TC0, TC0, TC0, TC0, TC0, TC1, TC1, TC1, TC1, TC1, TC1, TC2, TC2, TC2, TC2, TC2, TC2 };