]> git.sur5r.net Git - freertos/commitdiff
Update the SAM4L low power demo to use the ASF enable/disable interrupts functions...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 11 Nov 2013 14:49:36 +0000 (14:49 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 11 Nov 2013 14:49:36 +0000 (14:49 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2093 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/FreeRTOS_Demo.cproj
FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/SAM4L_low_power_tick_management.c

index a4d899029811b961b54f04ac0893c682f9b30d33..afaf06514c0a51d712d438d81020757e7eea8154 100644 (file)
@@ -18,7 +18,7 @@
     <ToolchainFlavour>Native</ToolchainFlavour>\r
     <KeepTimersRunning>true</KeepTimersRunning>\r
     <OverrideVtor>false</OverrideVtor>\r
-    <OverrideVtorValue />\r
+    <OverrideVtorValue>exception_table</OverrideVtorValue>\r
     <eraseonlaunchrule>1</eraseonlaunchrule>\r
     <AsfVersion>3.5.1</AsfVersion>\r
     <AsfFrameworkConfig>\r
     <avrtool>com.atmel.avrdbg.tool.samice</avrtool>\r
     <com_atmel_avrdbg_tool_samice>\r
       <ToolType>com.atmel.avrdbg.tool.samice</ToolType>\r
-      <ToolName>J-Link-OB-SAM3U128</ToolName>\r
-      <ToolNumber>000480008435</ToolNumber>\r
-      <KeepTimersRunning>true</KeepTimersRunning>\r
-      <OverrideVtor>false</OverrideVtor>\r
-      <OverrideVtorValue>\r
-      </OverrideVtorValue>\r
+      <ToolName>J-Link</ToolName>\r
+      <ToolNumber>000480008423</ToolNumber>\r
       <Channel>\r
         <host>127.0.0.1</host>\r
         <port>1882</port>\r
           <JtagDevicesAfter>0</JtagDevicesAfter>\r
           <JtagInstrBitsBefore>0</JtagInstrBitsBefore>\r
           <JtagInstrBitsAfter>0</JtagInstrBitsAfter>\r
-          <SwdClock>4000000</SwdClock>\r
+          <SwdClock>32000</SwdClock>\r
         </InterfaceProperties>\r
       </ToolOptions>\r
     </com_atmel_avrdbg_tool_samice>\r
     <CacheFlash>true</CacheFlash>\r
     <ProgFlashFromRam>true</ProgFlashFromRam>\r
-    <RamSnippetAddress />\r
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>\r
     <UncachedRange />\r
     <BootSegment>2</BootSegment>\r
   </PropertyGroup>\r
   <armgcc.compiler.optimization.OtherFlags>-fdata-sections</armgcc.compiler.optimization.OtherFlags>\r
   <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>\r
   <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>\r
-  <armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.compiler.miscellaneous.OtherFlags>\r
+  <armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.compiler.miscellaneous.OtherFlags>\r
   <armgcc.linker.libraries.Libraries>\r
     <ListValues>\r
       <Value>arm_cortexM4l_math</Value>\r
   </armgcc.linker.libraries.LibrarySearchPaths>\r
   <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>\r
   <armgcc.linker.miscellaneous.LinkerFlags>-T../src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld -Wl,--cref -Wl,--entry=Reset_Handler -mthumb</armgcc.linker.miscellaneous.LinkerFlags>\r
-  <armgcc.assembler.general.AssemblerFlags>-D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.assembler.general.AssemblerFlags>\r
+  <armgcc.assembler.general.AssemblerFlags>-D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.assembler.general.AssemblerFlags>\r
   <armgcc.assembler.general.IncludePaths>\r
     <ListValues>\r
       <Value>../src/asf/sam/utils/preprocessor</Value>\r
       <Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL\sam4l\include</Value>\r
     </ListValues>\r
   </armgcc.assembler.general.IncludePaths>\r
-  <armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM4=true -DBOARD=SAM4L_EK -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.preprocessingassembler.general.AssemblerFlags>\r
+  <armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM4=true -DBOARD=SAM4L_EK -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.preprocessingassembler.general.AssemblerFlags>\r
   <armgcc.preprocessingassembler.general.IncludePaths>\r
     <ListValues>\r
       <Value>../src/asf/sam/utils/preprocessor</Value>\r
   <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>\r
   <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>\r
   <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>\r
-  <armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -Wmissing-field-initializers -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.compiler.miscellaneous.OtherFlags>\r
+  <armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -Wmissing-field-initializers -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.compiler.miscellaneous.OtherFlags>\r
   <armgcc.linker.libraries.Libraries>\r
     <ListValues>\r
       <Value>libm</Value>\r
   </armgcc.linker.libraries.LibrarySearchPaths>\r
   <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>\r
   <armgcc.linker.miscellaneous.LinkerFlags>-T../src/asf/sam/utils/linker_scripts/sam4l/sam4l4/gcc/flash.ld -Wl,--cref -Wl,--entry=Reset_Handler -mthumb</armgcc.linker.miscellaneous.LinkerFlags>\r
-  <armgcc.assembler.general.AssemblerFlags>-D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.assembler.general.AssemblerFlags>\r
+  <armgcc.assembler.general.AssemblerFlags>-D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.assembler.general.AssemblerFlags>\r
   <armgcc.assembler.general.IncludePaths>\r
     <ListValues>\r
       <Value>../src/asf/sam/utils/preprocessor</Value>\r
     </ListValues>\r
   </armgcc.assembler.general.IncludePaths>\r
   <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>\r
-  <armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM4=true -DBOARD=SAM4L_EK -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.preprocessingassembler.general.AssemblerFlags>\r
+  <armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM4=true -DBOARD=SAM4L_EK -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__ -D__ATSAM4LC4C__</armgcc.preprocessingassembler.general.AssemblerFlags>\r
   <armgcc.preprocessingassembler.general.IncludePaths>\r
     <ListValues>\r
       <Value>../src/asf/sam/utils/preprocessor</Value>\r
index a00f30b35618784943720353ee22639b497c6bee..694b73d2b1927460bd389df0e2a00655f19df2a5 100644 (file)
@@ -253,7 +253,7 @@ asynchronous timer (AST), as the tick is generated from the low power AST and
 not the SysTick as would normally be the case on a Cortex-M. */\r
 void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime )\r
 {\r
-uint32_t ulAlarmValue, ulCompleteTickPeriods;\r
+uint32_t ulAlarmValue, ulCompleteTickPeriods, ulInterruptStatus;\r
 eSleepModeStatus eSleepAction;\r
 portTickType xModifiableIdleTime;\r
 enum sleepmgr_mode xSleepMode;\r
@@ -284,8 +284,7 @@ enum sleepmgr_mode xSleepMode;
 \r
        /* Enter a critical section but don't use the taskENTER_CRITICAL() method as\r
        that will mask interrupts that should exit sleep mode. */\r
-       __asm volatile( "cpsid i                \n\t"\r
-                                       "dsb                    \n\t" );\r
+       ulInterruptStatus = cpu_irq_save();\r
 \r
        /* The tick flag is set to false before sleeping.  If it is true when sleep\r
        mode is exited then sleep mode was probably exited because the tick was\r
@@ -303,7 +302,7 @@ enum sleepmgr_mode xSleepMode;
 \r
                /* Re-enable interrupts - see comments above the cpsid instruction()\r
                above. */\r
-               __asm volatile( "cpsie i" );\r
+               cpu_irq_restore( ulInterruptStatus );\r
        }\r
        else\r
        {\r
@@ -345,7 +344,7 @@ enum sleepmgr_mode xSleepMode;
 \r
                /* Re-enable interrupts - see comments above the cpsid instruction()\r
                above. */\r
-               __asm volatile( "cpsie i" );\r
+               cpu_irq_restore( ulInterruptStatus );\r
 \r
                if( ulTickFlag != pdFALSE )\r
                {\r