diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c
index 2ef6630ed2d8e3b06d10d2e419bd47b780e7ff14..f894a5b7df2475267b7206db7a9311827ab7caa6 100644
--- a/cores/arduino/wiring_analog.c
+++ b/cores/arduino/wiring_analog.c
@@ -119,7 +119,7 @@ void analogWrite( uint32_t ulPin, uint32_t ulValue )
 
   if ( (attr & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG )
   {
-    if ( ulPin != 24 )  // Only 1 DAC on A0 (PA02)
+    if ( ulPin != PIN_A0 )  // Only 1 DAC on A0 (PA02)
     {
       return;
     }