mirror of
https://github.com/esp8266/Arduino.git
synced 2025-12-01 17:57:53 +03:00
[sam] Working LED Blink on variant SAM3S-EK using IAR EWARM
This commit is contained in:
@@ -165,6 +165,8 @@ typedef struct _PinDescription
|
||||
EAnalogChannel dwAnalogChannel ;
|
||||
} PinDescription ;
|
||||
|
||||
extern const PinDescription APinDescription[] ;
|
||||
|
||||
#include "pins_arduino.h"
|
||||
|
||||
#endif // Arduino_h
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>OGLastSavedByProductVersion</name>
|
||||
<state>6.21.1.52845</state>
|
||||
<state>6.21.3.52923</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>GeneralEnableMisra</name>
|
||||
@@ -293,7 +293,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>CCIncludePath2</name>
|
||||
<state>$PROJ_DIR$/../../../variants/sam3s-ek</state>
|
||||
<state>$PROJ_DIR$/../../../variants/sam3s_ek</state>
|
||||
<state>$PROJ_DIR$/../../../system</state>
|
||||
</option>
|
||||
<option>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>MacFile</name>
|
||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\debug_scripts\iar\sam3s_ek_flash.mac</state>
|
||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_flash.mac</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MemOverride</name>
|
||||
@@ -77,7 +77,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadVerifyAll</name>
|
||||
<state>0</state>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCProductVersion</name>
|
||||
@@ -89,7 +89,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>OCLastSavedByProductVersion</name>
|
||||
<state>6.21.1.52845</state>
|
||||
<state>6.21.3.52923</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadAttachToProgram</name>
|
||||
@@ -97,7 +97,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>UseFlashLoader</name>
|
||||
<state>0</state>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CLowLevel</name>
|
||||
@@ -423,7 +423,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkResetList</name>
|
||||
<version>5</version>
|
||||
<version>6</version>
|
||||
<state>7</state>
|
||||
</option>
|
||||
<option>
|
||||
@@ -821,6 +821,10 @@
|
||||
</data>
|
||||
</settings>
|
||||
<debuggerPlugins>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
@@ -1300,7 +1304,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>CCJLinkResetList</name>
|
||||
<version>5</version>
|
||||
<version>6</version>
|
||||
<state>5</state>
|
||||
</option>
|
||||
<option>
|
||||
@@ -1698,6 +1702,10 @@
|
||||
</data>
|
||||
</settings>
|
||||
<debuggerPlugins>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>OGLastSavedByProductVersion</name>
|
||||
<state>6.21.1.52845</state>
|
||||
<state>6.21.3.52923</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>GeneralEnableMisra</name>
|
||||
@@ -294,7 +294,7 @@
|
||||
<option>
|
||||
<name>CCIncludePath2</name>
|
||||
<state>$PROJ_DIR$\..\..</state>
|
||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek</state>
|
||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek</state>
|
||||
<state>$PROJ_DIR$\..\..\..\..\system</state>
|
||||
</option>
|
||||
<option>
|
||||
@@ -688,7 +688,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>IlinkIcfFile</name>
|
||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\linker_scripts\iar\sam3s_ek_flash.icf</state>
|
||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_flash.icf</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>IlinkIcfFileSlave</name>
|
||||
@@ -1800,16 +1800,16 @@
|
||||
<group>
|
||||
<name>sam3s_ek</name>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\linker_scripts\iar\sam3s_ek_flash.icf</name>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_flash.icf</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\debug_scripts\iar\sam3s_ek_flash.mac</name>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_flash.mac</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\linker_scripts\iar\sam3s_ek_sram.icf</name>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_sram.icf</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\debug_scripts\iar\sam3s_ek_sram.mac</name>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_sram.mac</name>
|
||||
</file>
|
||||
</group>
|
||||
<group>
|
||||
@@ -1819,15 +1819,15 @@
|
||||
<group>
|
||||
<name>variants</name>
|
||||
<group>
|
||||
<name>sam3s-ek</name>
|
||||
<name>sam3s_ek</name>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\pins_arduino.h</name>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\pins_arduino.h</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\variant.cpp</name>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\variant.cpp</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\variant.h</name>
|
||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\variant.h</name>
|
||||
</file>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -2,22 +2,27 @@
|
||||
|
||||
void setup( void )
|
||||
{
|
||||
// initialize the digital pin as an output.
|
||||
// Pin PIN_LED has an LED connected on most Arduino boards:
|
||||
// Initialize the digital pin as an output.
|
||||
// Pin PIN_LED has a LED connected on most Arduino boards:
|
||||
pinMode( PIN_LED, OUTPUT ) ;
|
||||
pinMode( PIN_LED_RED, OUTPUT ) ;
|
||||
digitalWrite( PIN_LED_RED, HIGH ) ;
|
||||
digitalWrite( PIN_LED, LOW ) ;
|
||||
|
||||
// Initialize the PIN_LED_GREEN digital pin as an output.
|
||||
pinMode( PIN_LED_GREEN, OUTPUT ) ;
|
||||
digitalWrite( PIN_LED_GREEN, HIGH ) ;
|
||||
|
||||
// Serial1.begin( 19200 ) ;
|
||||
}
|
||||
|
||||
void loop( void )
|
||||
{
|
||||
//digitalWrite( PIN_LED, HIGH ) ; // set the LED on
|
||||
//delay( 1000 ) ; // wait for a second
|
||||
//digitalWrite( PIN_LED, LOW ) ; // set the LED off
|
||||
//delay( 1000 ) ; // wait for a second
|
||||
//
|
||||
digitalWrite( PIN_LED, HIGH ) ; // set the LED on
|
||||
digitalWrite( PIN_LED_GREEN, LOW ) ; // set the red LED off
|
||||
delay( 1000 ) ; // wait for a second
|
||||
digitalWrite( PIN_LED, LOW ) ; // set the LED off
|
||||
digitalWrite( PIN_LED_GREEN, HIGH ) ; // set the red LED on
|
||||
delay( 1000 ) ; // wait for a second
|
||||
|
||||
//Serial1.println( "test1" ) ; // send an initial string
|
||||
//delay( 1000 ) ; // wait for a second
|
||||
//Serial1.println( "test2" ) ; // send an initial string
|
||||
|
||||
@@ -92,16 +92,14 @@ extern void init( void )
|
||||
/* Disable watchdog, common to all SAM variants */
|
||||
WDT_Disable( WDT ) ;
|
||||
|
||||
SysTick_Config( VARIANT_MCK/1000 ) ;
|
||||
|
||||
// Initialize Serial port UART0, common to all SAM3 variants
|
||||
PIO_Configure( APinDescription[PINS_UART].pPort, APinDescription[PINS_UART].dwPinType,
|
||||
APinDescription[PINS_UART].dwPin, APinDescription[PINS_UART].dwPinAttribute ) ;
|
||||
|
||||
// Switch off Power LED
|
||||
PIO_Configure( APinDescription[PIN_LED_RED].pPort, APinDescription[PIN_LED_RED].dwPinType,
|
||||
APinDescription[PIN_LED_RED].dwPin, APinDescription[PIN_LED_RED].dwPinAttribute ) ;
|
||||
PIO_Clear( APinDescription[PIN_LED_RED].pPort, APinDescription[PIN_LED_RED].dwPin ) ;
|
||||
//PIO_Configure( APinDescription[PIN_LED_RED].pPort, APinDescription[PIN_LED_RED].dwPinType,
|
||||
// APinDescription[PIN_LED_RED].dwPin, APinDescription[PIN_LED_RED].dwPinAttribute ) ;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user