]> git.sur5r.net Git - freertos/commitdiff
Minor change to SAM4L_low_power_tick_management.c to ensure the alarm value cannot...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 8 Dec 2013 06:32:38 +0000 (06:32 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 8 Dec 2013 06:32:38 +0000 (06:32 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2120 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 afaf06514c0a51d712d438d81020757e7eea8154..44f28a52db7468ca3d517faad768e9a6aa6163da 100644 (file)
   <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__ -D__ATSAM4LC4C__</armgcc.compiler.miscellaneous.OtherFlags>\r
+  <armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -D__ATSAM4LC4C__ -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__ -D__ATSAM4LC4C__</armgcc.assembler.general.AssemblerFlags>\r
+  <armgcc.assembler.general.AssemblerFlags>-D__ATSAM4LC4C__ -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__ -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__ -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__ -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__ -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__ -D__ATSAM4LC4C__</armgcc.assembler.general.AssemblerFlags>\r
+  <armgcc.assembler.general.AssemblerFlags>-D__ATSAM4LC4C__ -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__ -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__ -D__ATSAM4LC4C__</armgcc.preprocessingassembler.general.AssemblerFlags>\r
   <armgcc.preprocessingassembler.general.IncludePaths>\r
     <ListValues>\r
       <Value>../src/asf/sam/utils/preprocessor</Value>\r
index 694b73d2b1927460bd389df0e2a00655f19df2a5..0f76945a4e8f204edfeefea57d569ad82d5fe257 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -248,7 +248,7 @@ static void prvEnableAST( void )
 /*-----------------------------------------------------------*/\r
 \r
 /* Override the default definition of vPortSuppressTicksAndSleep() that is weakly\r
-defined in the FreeRTOS Cortex-M3 port layet with a version that manages the\r
+defined in the FreeRTOS Cortex-M3 port layer with a version that manages the\r
 asynchronous timer (AST), as the tick is generated from the low power AST and\r
 not the SysTick as would normally be the case on a Cortex-M. */\r
 void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime )\r
@@ -372,6 +372,12 @@ enum sleepmgr_mode xSleepMode;
                        /* The alarm value is set to whatever fraction of a single tick\r
                        period remains. */\r
                        ulAlarmValue = ast_read_counter_value( AST ) - ( ulCompleteTickPeriods * ulAlarmValueForOneTick );\r
+                       if( ulAlarmValue == 0 )\r
+                       {\r
+                               /* There is no fraction remaining. */\r
+                               ulAlarmValue = ulAlarmValueForOneTick;\r
+                               ulCompleteTickPeriods++;\r
+                       }\r
                        ast_write_alarm0_value( AST, ulAlarmValue );\r
                }\r
 \r