]> git.sur5r.net Git - freertos/commitdiff
Remove driver files that generate compiler warnings from the RISC-V_Renode_Emulator_S...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 18 Nov 2019 17:23:14 +0000 (17:23 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 18 Nov 2019 17:23:14 +0000 (17:23 +0000)
Update RISC-V ports so the interrupt stack is set to a known value before the scheduler is started if the interrupt stack is statically defined rather than re-using the main.c() stack.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2754 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

17 files changed:
FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_IAR/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_IAR/settings/RTOSDemo.wsdt
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/.cproject
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/.settings/language.settings.xml
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_i2c.c [deleted file]
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/drivers/CoreI2C/i2c_interrupt.c [deleted file]
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/riscv_hal/syscall.c [deleted file]
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/blinky_demo/main_blinky.c
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/full_demo/main_full.c
FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/main.c
FreeRTOS/Demo/WIN32-MSVC-lwIP/WIN32.vcxproj
FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h
FreeRTOS/Source/portable/GCC/RISC-V/port.c
FreeRTOS/Source/portable/GCC/RISC-V/portASM.S
FreeRTOS/Source/portable/IAR/RISC-V/port.c
FreeRTOS/Source/portable/IAR/RISC-V/portASM.s

index 216c6dae182902a3436e9b5b1ecd48c7c4db99b0..c1be600590567a8ef3dbcfa429f46c30243969c4 100644 (file)
@@ -57,7 +57,7 @@
 #define configIDLE_SHOULD_YIELD                        0\r
 #define configUSE_MUTEXES                              1\r
 #define configQUEUE_REGISTRY_SIZE              8\r
-#define configCHECK_FOR_STACK_OVERFLOW 3\r
+#define configCHECK_FOR_STACK_OVERFLOW 2\r
 #define configUSE_RECURSIVE_MUTEXES            1\r
 #define configUSE_MALLOC_FAILED_HOOK   1\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
index bdceed166707c20382488b310db6f3bcccd2af45..038dfe810647481df72da6a11060a351a9673635 100644 (file)
@@ -56,7 +56,7 @@
                     <item>33054</item>\r
                     <item>0</item>\r
                     <item>33035</item>\r
-                    <item>33036</item>\r
+                    <item>33037</item>\r
                     <item>34399</item>\r
                     <item>0</item>\r
                     <item>33038</item>\r
                     <ExpandedNode>RTOSDemo/FreeRTOS_source/portable/memmang</ExpandedNode>\r
                     <ExpandedNode>RTOSDemo/SiFive_code</ExpandedNode>\r
                     <ExpandedNode>RTOSDemo/blinky_demo</ExpandedNode>\r
-                    <ExpandedNode>RTOSDemo/full_demo</ExpandedNode>\r
-                    <ExpandedNode>RTOSDemo/full_demo/common</ExpandedNode>\r
                 </NodeDict>\r
             </IarPane-34059>\r
             <ControlBarVersion>\r
                 <Major>14</Major>\r
-                <Minor>22</Minor>\r
+                <Minor>23</Minor>\r
             </ControlBarVersion>\r
             <MFCToolBarParameters>\r
                 <Tooltips>1</Tooltips>\r
             <Pane-59393>\r
                 <ID>0</ID>\r
                 <RectRecentFloat>0A0000000A0000006E0000006E000000</RectRecentFloat>\r
-                <RectRecentDocked>0000000057050000000A00006A050000</RectRecentDocked>\r
+                <RectRecentDocked>0000000058050000700D00006B050000</RectRecentDocked>\r
                 <RecentFrameAlignment>4096</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
             </BasePane-59393>\r
             <Pane--1>\r
                 <ID>4294967295</ID>\r
-                <RectRecentFloat>0000000089040000000A00006E050000</RectRecentFloat>\r
-                <RectRecentDocked>0000000072040000000A000057050000</RectRecentDocked>\r
+                <RectRecentFloat>000000004A020000000600002F030000</RectRecentFloat>\r
+                <RectRecentDocked>0000000073040000700D000058050000</RectRecentDocked>\r
                 <RecentFrameAlignment>4096</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
             <Pane-34049>\r
                 <ID>34049</ID>\r
                 <RectRecentFloat>210100008A03000098080000F0040000</RectRecentFloat>\r
-                <RectRecentDocked>040000008A040000FC0900003D050000</RectRecentDocked>\r
+                <RectRecentDocked>040000008B0400006C0D00003E050000</RectRecentDocked>\r
                 <RecentFrameAlignment>32768</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
             <Pane-34052>\r
                 <ID>34052</ID>\r
                 <RectRecentFloat>210100008A03000098080000F0040000</RectRecentFloat>\r
-                <RectRecentDocked>040000008A040000FC0900003D050000</RectRecentDocked>\r
+                <RectRecentDocked>040000008B040000FC0500003E050000</RectRecentDocked>\r
                 <RecentFrameAlignment>32768</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
             <Pane-34053>\r
                 <ID>34053</ID>\r
                 <RectRecentFloat>210100008A03000098080000F0040000</RectRecentFloat>\r
-                <RectRecentDocked>040000008A040000FC0900003D050000</RectRecentDocked>\r
+                <RectRecentDocked>040000008B040000FC0500003E050000</RectRecentDocked>\r
                 <RecentFrameAlignment>32768</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
             <Pane-34054>\r
                 <ID>34054</ID>\r
                 <RectRecentFloat>210100008A03000098080000F0040000</RectRecentFloat>\r
-                <RectRecentDocked>040000008A040000FC0900003D050000</RectRecentDocked>\r
+                <RectRecentDocked>040000008B040000FC0500003E050000</RectRecentDocked>\r
                 <RecentFrameAlignment>32768</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
                 <ColumnWidth2>1144</ColumnWidth2>\r
                 <ColumnWidth3>508</ColumnWidth3>\r
                 <FilterLevel>2</FilterLevel>\r
-                <LiveFile></LiveFile>\r
+                <LiveFile />\r
                 <LiveLogEnabled>0</LiveLogEnabled>\r
                 <LiveFilterLevel>-1</LiveFilterLevel>\r
             </IarPane-34054>\r
             <Pane-34055>\r
                 <ID>34055</ID>\r
                 <RectRecentFloat>210100008A03000098080000F0040000</RectRecentFloat>\r
-                <RectRecentDocked>040000008A040000FC0900003D050000</RectRecentDocked>\r
+                <RectRecentDocked>040000008B040000FC0500003E050000</RectRecentDocked>\r
                 <RecentFrameAlignment>32768</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
                 <PinState>0</PinState>\r
             </Pane-34055>\r
             <BasePane-34055>\r
-                <IsVisible>1</IsVisible>\r
+                <IsVisible>0</IsVisible>\r
             </BasePane-34055>\r
             <IarPane-34055>\r
-                <ColumnWidth0>1198</ColumnWidth0>\r
-                <ColumnWidth1>171</ColumnWidth1>\r
-                <ColumnWidth2>2054</ColumnWidth2>\r
+                <ColumnWidth0>532</ColumnWidth0>\r
+                <ColumnWidth1>76</ColumnWidth1>\r
+                <ColumnWidth2>912</ColumnWidth2>\r
                 <FilterLevel>2</FilterLevel>\r
                 <LiveFile />\r
                 <LiveLogEnabled>0</LiveLogEnabled>\r
             <Pane-34058>\r
                 <ID>34058</ID>\r
                 <RectRecentFloat>210100008A03000098080000F0040000</RectRecentFloat>\r
-                <RectRecentDocked>040000008A040000FC0900003D050000</RectRecentDocked>\r
+                <RectRecentDocked>040000008B040000FC0500003E050000</RectRecentDocked>\r
                 <RecentFrameAlignment>32768</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
             <Pane-34056>\r
                 <ID>34056</ID>\r
                 <RectRecentFloat>000000001700000022010000C8000000</RectRecentFloat>\r
-                <RectRecentDocked>040000008A040000FC0900003D050000</RectRecentDocked>\r
+                <RectRecentDocked>040000008B0400006C0D00003E050000</RectRecentDocked>\r
                 <RecentFrameAlignment>32768</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
             <Pane-34059>\r
                 <ID>34059</ID>\r
                 <RectRecentFloat>00000000170000000601000078010000</RectRecentFloat>\r
-                <RectRecentDocked>0000000032000000DD0100006E040000</RectRecentDocked>\r
+                <RectRecentDocked>0000000032000000DD0100006F040000</RectRecentDocked>\r
                 <RecentFrameAlignment>4096</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
                 <IsVisible>1</IsVisible>\r
             </BasePane-34059>\r
             <DockingManager-256>\r
-                <DockingPaneAndPaneDividers>0000000010000000000000000010000001000000FFFFFFFFFFFFFFFFDD01000032000000E10100006E040000010000000200001004000000010000000AFFFFFFD70500000B85000000000000000000000000000000000000010000000B850000010000000B850000000000000080000000000000FFFFFFFFFFFFFFFF00000000000000000400000004000000000000000100000004000000010000000000000000000000098500000000000000000000000000000000000001000000098500000100000009850000000000000080000001000000FFFFFFFFFFFFFFFF000000006E040000000A000072040000010000000100001004000000010000009DFEFFFF38010000FFFFFFFF070000000885000001850000048500000585000006850000078500000A850000FFFF02000B004354616262656450616E6500800000010000000000000089040000000A00006E0500000000000072040000000A000057050000000000004080005607000000FFFEFF1153006F0075007200630065002000420072006F0077007300650020004C006F006700010000000885000001000000FFFFFFFFFFFFFFFFFFFEFF054200750069006C006400010000000185000001000000FFFFFFFFFFFFFFFFFFFEFF0C4400650063006C00610072006100740069006F006E007300000000000485000001000000FFFFFFFFFFFFFFFFFFFEFF0A5200650066006500720065006E00630065007300000000000585000001000000FFFFFFFFFFFFFFFFFFFEFF0D460069006E006400200069006E002000460069006C0065007300000000000685000001000000FFFFFFFFFFFFFFFFFFFEFF1541006D0062006900670075006F0075007300200044006500660069006E006900740069006F006E007300010000000785000001000000FFFFFFFFFFFFFFFFFFFEFF0B54006F006F006C0020004F0075007400700075007400000000000A85000001000000FFFFFFFFFFFFFFFF01000000000000000000000000000000000000000000000001000000FFFFFFFF0885000001000000FFFFFFFF08850000000000000080000000000000FFFFFFFFFFFFFFFF00000000000000000400000004000000000000000100000004000000010000000000000000000000038500000000000000000000000000000000000001000000038500000100000003850000000000000080000000000000FFFFFFFFFFFFFFFF00000000000000000400000004000000000000000100000004000000010000000000000000000000028500000000000000000000000000000000000001000000028500000100000002850000000000000080000000000000FFFFFFFFFFFFFFFF000000000000000004000000040000000000000001000000040000000100000000000000000000000D85000000000000000000000000000000000000010000000D850000010000000D850000000000000080000000000000FFFFFFFFFFFFFFFF000000000000000004000000040000000000000001000000040000000100000000000000000000000C85000000000000000000000000000000000000010000000C850000010000000C850000000000000080000000000000FFFFFFFFFFFFFFFF00000000A2040000000A0000A6040000000000000100000004000000010000000000000000000000FFFFFFFF010000000E8500000180008000000000000000000000BD040000000A00006E05000000000000A6040000000A000057050000000000004080004601000000FFFEFF094400650062007500670020004C006F006700000000000E85000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFF0E85000001000000FFFFFFFF0E850000000000000000000000000000</DockingPaneAndPaneDividers>\r
+                <DockingPaneAndPaneDividers>0000000010000000000000000010000001000000FFFFFFFFFFFFFFFFDD01000032000000E10100006F040000010000000200001004000000010000000AFFFFFFD70500000B85000000000000000000000000000000000000010000000B850000010000000B850000000000000080000000000000FFFFFFFFFFFFFFFF00000000000000000400000004000000000000000100000004000000010000000000000000000000098500000000000000000000000000000000000001000000098500000100000009850000000000000080000001000000FFFFFFFFFFFFFFFF000000006F040000700D000073040000010000000100001004000000010000009DFEFFFF38010000FFFFFFFF070000000885000001850000048500000585000006850000078500000A850000FFFF02000B004354616262656450616E650080000001000000000000004A020000000600002F0300000000000073040000700D000058050000000000004080005607000000FFFEFF1153006F0075007200630065002000420072006F0077007300650020004C006F006700010000000885000001000000FFFFFFFFFFFFFFFFFFFEFF054200750069006C006400010000000185000001000000FFFFFFFFFFFFFFFFFFFEFF0C4400650063006C00610072006100740069006F006E007300000000000485000001000000FFFFFFFFFFFFFFFFFFFEFF0A5200650066006500720065006E00630065007300000000000585000001000000FFFFFFFFFFFFFFFFFFFEFF0D460069006E006400200069006E002000460069006C0065007300000000000685000001000000FFFFFFFFFFFFFFFFFFFEFF1541006D0062006900670075006F0075007300200044006500660069006E006900740069006F006E007300000000000785000001000000FFFFFFFFFFFFFFFFFFFEFF0B54006F006F006C0020004F0075007400700075007400000000000A85000001000000FFFFFFFFFFFFFFFF01000000000000000000000000000000000000000000000001000000FFFFFFFF0885000001000000FFFFFFFF08850000000000000080000000000000FFFFFFFFFFFFFFFF00000000000000000400000004000000000000000100000004000000010000000000000000000000038500000000000000000000000000000000000001000000038500000100000003850000000000000080000000000000FFFFFFFFFFFFFFFF00000000000000000400000004000000000000000100000004000000010000000000000000000000028500000000000000000000000000000000000001000000028500000100000002850000000000000080000000000000FFFFFFFFFFFFFFFF000000000000000004000000040000000000000001000000040000000100000000000000000000000D85000000000000000000000000000000000000010000000D850000010000000D850000000000000080000000000000FFFFFFFFFFFFFFFF000000000000000004000000040000000000000001000000040000000100000000000000000000000C85000000000000000000000000000000000000010000000C850000010000000C850000000000000080000000000000FFFFFFFFFFFFFFFF00000000A3040000700D0000A7040000000000000100000004000000010000000000000000000000FFFFFFFF010000000E85000001800080000000000000000000007E020000000600002F03000000000000A7040000700D000058050000000000004080004601000000FFFEFF094400650062007500670020004C006F006700000000000E85000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFF0E85000001000000FFFFFFFF0E850000000000000000000000000000</DockingPaneAndPaneDividers>\r
             </DockingManager-256>\r
             <MFCToolBar-34048>\r
                 <Name>Main</Name>\r
-                <Buttons>00200000010000002000FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000035000000FFFEFF000000000000000000000000000100000001000000018001E100000000000036000000FFFEFF000000000000000000000000000100000001000000018003E100000000040038000000FFFEFF0000000000000000000000000001000000010000000180008100000000000019000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF000000000000000000000000000100000001000000018007E10000000004003B000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF000000000000000000000000000100000001000000018023E10000000004003D000000FFFEFF000000000000000000000000000100000001000000018022E10000000004003C000000FFFEFF000000000000000000000000000100000001000000018025E10000000004003F000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF00000000000000000000000000010000000100000001802BE100000000040042000000FFFEFF00000000000000000000000000010000000100000001802CE100000000040043000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6E4281000000000400FFFFFFFFFFFEFF0000000000000000000100000000000000010000007800000002002050FFFFFFFFFFFEFF0096000000000000004800FFFEFF042E0065006E006400FFFEFF0C70007800430075007200720065006E007400540043004200FFFEFF076D00730074006100740075007300FFFEFF046D00650070006300FFFEFF066D0063006100750073006500FFFEFF095F005F00610072006D00200076006F006C00FFFEFF0D5F005F00610072006D00200076006F006C00610069006C006500FFFEFF0E5F005F00610073006D00200076006F006C006100740069006C006500FFFEFF056D007400760065006300FFFEFF1278005400610073006B0049006E006300720065006D0065006E0074005400690063006B00FFFEFF0870006F0072007400480041004E004400FFFEFF0470006F0072007400FFFEFF0363006C007A00FFFEFF095500530045005F0050004F00520054005F00FFFEFF1F700075006C006C004D0061006300680069006E006500540069006D006500720043006F006D00700061007200650052006500670069007300740065007200FFFEFF055F005F00610073006D00FFFEFF0C780049005300520053007400610063006B0054006F007000FFFEFF1A63006F006E006600690067004900530052005F0053005400410043004B005F00530049005A0045005F0057004F00520044005300FFFEFF1B75007800540069006D006500720049006E006300720065006D0065006E007400730046006F0072004F006E0065005400690063006B00FFFEFF107000720076005300650074007500700048006100720064007700610072006500FFFEFF0955004100520054005F005200450047005700FFFEFF0B55004100520054005F0054005800460055004C004C00FFFEFF164D004500540041004C005F005300490046004900560045005F00550041005200540030005F00440049005600FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F00540058004300540052004C00FFFEFF0F7400610073006B00520045005300450054005F0052004500410044005900FFFEFF0855004100520054005F00520045004700FFFEFF18700072007600530065007400750070005000650072006900700068006500720061006C00540069006D00650072007300FFFEFF06650062007200650061006B00FFFEFF0C63006F006E00660069006700410053005300450052005400FFFEFF095400490043004B005F0048004F004F004B00FFFEFF0575006C00520065006700FFFEFF16700075006C00520065006700540065007300740031004C006F006F00700043006F0075006E00740065007200FFFEFF1575006C00520065006700540065007300740032004C006F006F00700043006F0075006E00740065007200FFFEFF087400690063006B0068006F006F006B00FFFEFF0A73006500740075007000740069006D0065007200FFFEFF0C70007200760043006800650063006B005400610073006B00FFFEFF116D00610069006E0055004100520054005F0052004500470049005300540045005200FFFEFF0873007400610072007400730063006800FFFEFF1175006C0043006800650063006B005400610073006B004300790063006C0065007300FFFEFF1078004500720072006F0072004F00630063007500720072006500640020003D00FFFEFF0974006F00670067006C0065006C0065006400FFFEFF156D00610069006E005200450044005F004C00450044005F004700500049004F005F0050004F0052005400FFFEFF146D00610069006E0055004100520054005F00540058005F00460055004C004C005F00420049005400FFFEFF156D00610069006E00550041005200540030005F00540058005F0044004100540041005F00520045004700FFFEFF204D004500540041004C005F005300490046004900560045005F00550041005200540030005F00310030003000310033003000300030005F00530049005A004500FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F0030005F00530049005A004500FFFEFF124D004500540041004C005F005300490046004900560045005F0055004100520054003000FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F00540058004400410054004100FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F00520058004400410054004100FFFEFF0674006F00670067006C006500FFFEFF1178004500720072006F0072004F00630063007500720072006500640020003D002000FFFEFF1270007200760042006100730069006300440065006C006100790054006500730074007300FFFEFF0E78005000720069006D006100720079004300790063006C0065007300FFFEFF1976005000720069006D0061007200790042006C006F0063006B00540069006D00650054006500730074005400610073006B00FFFEFF0F5400610073006B005000720069006F007200690074007900530065007400FFFEFF12700072007600530069006E0067006C0065005400610073006B0054006500730074007300FFFEFF187000720076004E006F006E0042006C006F0063006B0069006E006700530065006E006400650072005400610073006B00FFFEFF0B6E006F006E0062006C006F0063006B0069006E006700FFFEFF0D7000720076004500630068006F00530065007200760065007200FFFEFF1F63006F006E0066006900670053005500500050004F00520054005F005300540041005400490043005F0041004C004C004F0043004100540049004F004E00FFFEFF0D7000720076004500630068006F0043006C00690065006E007400FFFEFF2F730074006100740069006300200076006F006900640020007000720076004500630068006F0043006C00690065006E0074002800200076006F006900640020002A007000760050006100720061006D006500740065007200730020002900FFFEFF0770006F00720074005F006F007000FFFEFF0E76005400610073006B00440065006C00610079002800200070006F00FFFEFF0A53005400410043004B005F004F00560045005200FFFEFF09780049005300520053007400610063006B00FFFEFF0F730074006100720074007300630068006500640075006C00650072006500FFFEFF066D0065006D00730065007400FFFEFF1770006F00720074004900530052005F0053005400410043004B005F00460049004C004C005F004200590054004500FFFEFF0773007400610063006B005F007600FFFEFF0A73007400610063006B005F006F00760065007200FFFEFF062E0061006C00690067006E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018021810000000004002C000000FFFEFF000000000000000000000000000100000001000000018024E10000000004003E000000FFFEFF000000000000000000000000000100000001000000018028E100000000040040000000FFFEFF000000000000000000000000000100000001000000018029E100000000040041000000FFFEFF000000000000000000000000000100000001000000018002810000000004001B000000FFFEFF0000000000000000000000000001000000010000000180298100000000040030000000FFFEFF000000000000000000000000000100000001000000018027810000000004002E000000FFFEFF000000000000000000000000000100000001000000018028810000000004002F000000FFFEFF00000000000000000000000000010000000100000001801D8100000000040028000000FFFEFF00000000000000000000000000010000000100000001801E8100000000040029000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF00000000000000000000000000010000000100000001800B810000000004001F000000FFFEFF00000000000000000000000000010000000100000001800C8100000000000020000000FFFEFF00000000000000000000000000010000000100000001805F8600000000000034000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF00000000000000000000000000010000000100000001800E8100000000000022000000FFFEFF00000000000000000000000000010000000100000001800F8100000000000023000000FFFEFF00000000000000000000000000010000000100000000000000FFFEFF044D00610069006E00E8020000</Buttons>\r
+                <Buttons>00200000010000002000FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000035000000FFFEFF000000000000000000000000000100000001000000018001E100000000000036000000FFFEFF000000000000000000000000000100000001000000018003E100000000000038000000FFFEFF0000000000000000000000000001000000010000000180008100000000000019000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF000000000000000000000000000100000001000000018007E10000000000003B000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF000000000000000000000000000100000001000000018023E10000000004003D000000FFFEFF000000000000000000000000000100000001000000018022E10000000004003C000000FFFEFF000000000000000000000000000100000001000000018025E10000000000003F000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF00000000000000000000000000010000000100000001802BE100000000000042000000FFFEFF00000000000000000000000000010000000100000001802CE100000000040043000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6E4281000000000000FFFFFFFFFFFEFF0000000000000000000100000000000000010000007800000002002050FFFFFFFFFFFEFF0096000000000000004800FFFEFF042E0065006E006400FFFEFF0C70007800430075007200720065006E007400540043004200FFFEFF076D00730074006100740075007300FFFEFF046D00650070006300FFFEFF066D0063006100750073006500FFFEFF095F005F00610072006D00200076006F006C00FFFEFF0D5F005F00610072006D00200076006F006C00610069006C006500FFFEFF0E5F005F00610073006D00200076006F006C006100740069006C006500FFFEFF056D007400760065006300FFFEFF1278005400610073006B0049006E006300720065006D0065006E0074005400690063006B00FFFEFF0870006F0072007400480041004E004400FFFEFF0470006F0072007400FFFEFF0363006C007A00FFFEFF095500530045005F0050004F00520054005F00FFFEFF1F700075006C006C004D0061006300680069006E006500540069006D006500720043006F006D00700061007200650052006500670069007300740065007200FFFEFF055F005F00610073006D00FFFEFF0C780049005300520053007400610063006B0054006F007000FFFEFF1A63006F006E006600690067004900530052005F0053005400410043004B005F00530049005A0045005F0057004F00520044005300FFFEFF1B75007800540069006D006500720049006E006300720065006D0065006E007400730046006F0072004F006E0065005400690063006B00FFFEFF107000720076005300650074007500700048006100720064007700610072006500FFFEFF0955004100520054005F005200450047005700FFFEFF0B55004100520054005F0054005800460055004C004C00FFFEFF164D004500540041004C005F005300490046004900560045005F00550041005200540030005F00440049005600FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F00540058004300540052004C00FFFEFF0F7400610073006B00520045005300450054005F0052004500410044005900FFFEFF0855004100520054005F00520045004700FFFEFF18700072007600530065007400750070005000650072006900700068006500720061006C00540069006D00650072007300FFFEFF06650062007200650061006B00FFFEFF0C63006F006E00660069006700410053005300450052005400FFFEFF095400490043004B005F0048004F004F004B00FFFEFF0575006C00520065006700FFFEFF16700075006C00520065006700540065007300740031004C006F006F00700043006F0075006E00740065007200FFFEFF1575006C00520065006700540065007300740032004C006F006F00700043006F0075006E00740065007200FFFEFF087400690063006B0068006F006F006B00FFFEFF0A73006500740075007000740069006D0065007200FFFEFF0C70007200760043006800650063006B005400610073006B00FFFEFF116D00610069006E0055004100520054005F0052004500470049005300540045005200FFFEFF0873007400610072007400730063006800FFFEFF1175006C0043006800650063006B005400610073006B004300790063006C0065007300FFFEFF1078004500720072006F0072004F00630063007500720072006500640020003D00FFFEFF0974006F00670067006C0065006C0065006400FFFEFF156D00610069006E005200450044005F004C00450044005F004700500049004F005F0050004F0052005400FFFEFF146D00610069006E0055004100520054005F00540058005F00460055004C004C005F00420049005400FFFEFF156D00610069006E00550041005200540030005F00540058005F0044004100540041005F00520045004700FFFEFF204D004500540041004C005F005300490046004900560045005F00550041005200540030005F00310030003000310033003000300030005F00530049005A004500FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F0030005F00530049005A004500FFFEFF124D004500540041004C005F005300490046004900560045005F0055004100520054003000FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F00540058004400410054004100FFFEFF194D004500540041004C005F005300490046004900560045005F00550041005200540030005F00520058004400410054004100FFFEFF0674006F00670067006C006500FFFEFF1178004500720072006F0072004F00630063007500720072006500640020003D002000FFFEFF1270007200760042006100730069006300440065006C006100790054006500730074007300FFFEFF0E78005000720069006D006100720079004300790063006C0065007300FFFEFF1976005000720069006D0061007200790042006C006F0063006B00540069006D00650054006500730074005400610073006B00FFFEFF0F5400610073006B005000720069006F007200690074007900530065007400FFFEFF12700072007600530069006E0067006C0065005400610073006B0054006500730074007300FFFEFF187000720076004E006F006E0042006C006F0063006B0069006E006700530065006E006400650072005400610073006B00FFFEFF0B6E006F006E0062006C006F0063006B0069006E006700FFFEFF0D7000720076004500630068006F00530065007200760065007200FFFEFF1F63006F006E0066006900670053005500500050004F00520054005F005300540041005400490043005F0041004C004C004F0043004100540049004F004E00FFFEFF0D7000720076004500630068006F0043006C00690065006E007400FFFEFF2F730074006100740069006300200076006F006900640020007000720076004500630068006F0043006C00690065006E0074002800200076006F006900640020002A007000760050006100720061006D006500740065007200730020002900FFFEFF0770006F00720074005F006F007000FFFEFF0E76005400610073006B00440065006C00610079002800200070006F00FFFEFF0A53005400410043004B005F004F00560045005200FFFEFF09780049005300520053007400610063006B00FFFEFF0F730074006100720074007300630068006500640075006C00650072006500FFFEFF066D0065006D00730065007400FFFEFF1770006F00720074004900530052005F0053005400410043004B005F00460049004C004C005F004200590054004500FFFEFF0773007400610063006B005F007600FFFEFF0A73007400610063006B005F006F00760065007200FFFEFF062E0061006C00690067006E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018021810000000000002C000000FFFEFF000000000000000000000000000100000001000000018024E10000000000003E000000FFFEFF000000000000000000000000000100000001000000018028E100000000000040000000FFFEFF000000000000000000000000000100000001000000018029E100000000000041000000FFFEFF000000000000000000000000000100000001000000018002810000000000001B000000FFFEFF0000000000000000000000000001000000010000000180298100000000000030000000FFFEFF000000000000000000000000000100000001000000018027810000000000002E000000FFFEFF000000000000000000000000000100000001000000018028810000000000002F000000FFFEFF00000000000000000000000000010000000100000001801D8100000000000028000000FFFEFF00000000000000000000000000010000000100000001801E8100000000040029000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF00000000000000000000000000010000000100000001800B810000000004001F000000FFFEFF00000000000000000000000000010000000100000001800D8100000000000021000000FFFEFF00000000000000000000000000010000000100000001805F8600000000000034000000FFFEFF00000000000000000000000000010000000100000001800000000001000000FFFFFFFFFFFEFF00000000000000000000000000010000000100000001800E8100000000000022000000FFFEFF00000000000000000000000000010000000100000001800F8100000000000023000000FFFEFF00000000000000000000000000010000000100000000000000FFFEFF044D00610069006E00E8020000</Buttons>\r
             </MFCToolBar-34048>\r
             <Pane-34048>\r
                 <ID>34048</ID>\r
             </BasePane-34048>\r
             <IarPane-34062>\r
                 <ColumnWidth0>21</ColumnWidth0>\r
-                <ColumnWidth1>2497</ColumnWidth1>\r
+                <ColumnWidth1>3394</ColumnWidth1>\r
                 <FilterLevel>2</FilterLevel>\r
                 <LiveFile></LiveFile>\r
                 <LiveLogEnabled>0</LiveLogEnabled>\r
             <Pane-34062>\r
                 <ID>34062</ID>\r
                 <RectRecentFloat>000000001700000022010000C8000000</RectRecentFloat>\r
-                <RectRecentDocked>00000000BA040000000A000057050000</RectRecentDocked>\r
+                <RectRecentDocked>00000000BB040000700D000058050000</RectRecentDocked>\r
                 <RecentFrameAlignment>4096</RecentFrameAlignment>\r
                 <RecentRowIndex>0</RecentRowIndex>\r
                 <IsFloating>0</IsFloating>\r
         </Desktop>\r
         <MDIWindows>\r
             <MDIClientArea-0>\r
-                <MDITabsState>0100000003000000010000000000000000000000010000000100000002000000000000000100000001000000000000002800000028000000010000000F0000000200000001000000FFFEFF252400570053005F0044004900520024005C002E002E005C0043006F006D006D006F006E005C004D0069006E0069006D0061006C005C0062006C006F0063006B00740069006D002E00630001000000FFFF010014004966436F6E74656E7453746F72616765496D706CFFFEFF00FFFEFFFF2A013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003400350034003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E00310037003400390038003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E00310037003400390038003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0A62006C006F0063006B00740069006D002E00630000000000FFFFFFFFFFFFFFFFFFFEFF0F2400570053005F0044004900520024005C006D00610069006E002E006300010000000180FFFEFF00FFFEFFFF28013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003100360036003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0037003400320035003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0037003400320035003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF066D00610069006E002E00630000000000FFFFFFFFFFFFFFFFFFFEFF1E2400570053005F0044004900520024005C00660075006C006C005F00640065006D006F005C006D00610069006E005F00660075006C006C002E006300010000000180FFFEFF00FFFEFFFF22013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003100350038003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0030003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0030003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0B6D00610069006E005F00660075006C006C002E00630000000000FFFFFFFFFFFFFFFFFFFEFF192400570053005F0044004900520024005C004600720065006500520054004F00530043006F006E006600690067002E006800010000000180FFFEFF00FFFEFFFF27013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E00340030003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0034003100350030003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0034003100350030003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF104600720065006500520054004F00530043006F006E006600690067002E00680000000000FFFFFFFFFFFFFFFFFFFEFF2E2400570053005F0044004900520024005C002E002E005C0043006F006D006D006F006E005C004D0069006E0069006D0061006C005C004D00650073007300610067006500420075006600660065007200440065006D006F002E006300010000000180FFFEFF00FFFEFFFF2A013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003700330034003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E00330032003500350031003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E00330032003500350031003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF134D00650073007300610067006500420075006600660065007200440065006D006F002E00630000000000FFFFFFFFFFFFFFFFFFFEFF282400570053005F0044004900520024005C002E002E005C002E002E005C0053006F0075007200630065005C0069006E0063006C007500640065005C004600720065006500520054004F0053002E006800010000000180FFFEFF00FFFEFFFF2A013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003800310034003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E00320034003300350032003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E00320034003300350032003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0A4600720065006500520054004F0053002E00680000000000FFFFFFFFFFFFFFFFFFFEFF262400570053005F0044004900520024005C002E002E005C0043006F006D006D006F006E005C004D0069006E0069006D0061006C005C00540069006D0065007200440065006D006F002E006300010000000180FFFEFF00FFFEFFFF28013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003700330039003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0036003800330033003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0036003800330033003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0B540069006D0065007200440065006D006F002E00630000000000FFFFFFFFFFFFFFFFFFFEFF1D2400570053005F0044004900520024005C002E002E005C002E002E005C0053006F0075007200630065005C007400610073006B0073002E006300010000000180FFFEFF00FFFEFFFF2B013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E0031003100340033003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E00340035003200300031003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E00340035003200300031003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF077400610073006B0073002E00630000000000FFFFFFFFFFFFFFFFFFFEFF332400570053005F0044004900520024005C002E002E005C002E002E005C0053006F0075007200630065005C0070006F0072007400610062006C0065005C004900410052005C0052004900530043002D0056005C0070006F0072007400410053004D002E007300010000000180FFFEFF00FFFEFFFF27013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E00360033003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0033003800350031003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0033003800350031003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0970006F0072007400410053004D002E00730000000000FFFFFFFFFFFFFFFFFFFEFF302400570053005F0044004900520024005C002E002E005C002E002E005C0053006F0075007200630065005C0070006F0072007400610062006C0065005C004900410052005C0052004900530043002D0056005C0070006F00720074002E006300010000000180FFFEFF00FFFEFFFF28013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003100320034003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0037003200390034003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0037003200390034003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0670006F00720074002E00630000000000FFFFFFFFFFFFFFFFFFFEFF352400570053005F0044004900520024005C002E002E005C002E002E005C0053006F0075007200630065005C0070006F0072007400610062006C0065005C004900410052005C0052004900530043002D0056005C0070006F00720074006D006100630072006F002E006800010000000180FFFEFF00FFFEFFFF21013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E00370039003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0030003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0030003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0B70006F00720074006D006100630072006F002E00680000000000FFFFFFFFFFFFFFFFFFFEFF242400570053005F0044004900520024005C002E002E005C0043006F006D006D006F006E005C004D0069006E0069006D0061006C005C00640079006E0061006D00690063002E006300010000000180FFFEFF00FFFEFFFF28013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003100310039003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0037003100360035003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0037003100360035003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF09640079006E0061006D00690063002E00630000000000FFFFFFFFFFFFFFFFFFFEFF272400570053005F0044004900520024005C002E002E005C0043006F006D006D006F006E005C004D0069006E0069006D0061006C005C005400610073006B004E006F0074006900660079002E006300010000000180FFFEFF00FFFEFFFF27013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E00370038003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0033003800300030003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0033003800300030003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0C5400610073006B004E006F0074006900660079002E00630000000000FFFFFFFFFFFFFFFFFFFEFF1C2400570053005F0044004900520024005C00660075006C006C005F00640065006D006F005C0052006500670054006500730074002E007300010000000180FFFEFF00FFFEFFFF28013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003100310037003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0034003000390035003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0034003000390035003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0952006500670054006500730074002E00730000000000FFFFFFFFFFFFFFFFFFFEFF222400570053005F0044004900520024005C0062006C0069006E006B0079005F00640065006D006F005C006D00610069006E005F0062006C0069006E006B0079002E006300010000000180FFFEFF00FFFEFFFF28013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003100300031003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0035003200360037003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0035003200360037003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0D6D00610069006E005F0062006C0069006E006B0079002E00630000000000FFFFFFFFFFFFFFFF0000000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000100000002000000E101000049000000000A000085040000</MDITabsState>\r
+                <MDITabsState>010000000300000001000000000000000000000001000000010000000200000000000000010000000100000000000000280000002800000001000000040000000200000001000000FFFEFF0F2400570053005F0044004900520024005C006D00610069006E002E00630001000000FFFF010014004966436F6E74656E7453746F72616765496D706CFFFEFF00FFFEFFFF2A013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003200340033003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E00310030003500360031003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E00310030003500360031003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF066D00610069006E002E00630000000000FFFFFFFFFFFFFFFFFFFEFF302400570053005F0044004900520024005C002E002E005C002E002E005C0053006F0075007200630065005C0070006F0072007400610062006C0065005C004900410052005C0052004900530043002D0056005C0070006F00720074002E006300010000000180FFFEFF00FFFEFFFF27013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E00350037003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0034003500320038003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0034003500350038003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0670006F00720074002E00630000000000FFFFFFFFFFFFFFFFFFFEFF192400570053005F0044004900520024005C004600720065006500520054004F00530043006F006E006600690067002E006800010000000180FFFEFF00FFFEFFFF27013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E00320035003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0032003600350039003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0032003600350039003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF104600720065006500520054004F00530043006F006E006600690067002E00680000000000FFFFFFFFFFFFFFFFFFFEFF332400570053005F0044004900520024005C002E002E005C002E002E005C0053006F0075007200630065005C0070006F0072007400610062006C0065005C004900410052005C0052004900530043002D0056005C0070006F0072007400410053004D002E007300010000000180FFFEFF00FFFEFFFF28013C003F0078006D006C002000760065007200730069006F006E003D00220031002E0030002200200065006E0063006F00640069006E0067003D0022005500540046002D00380022003F003E000A003C0052006F006F0074003E000A0020002000200020003C004E0075006D0052006F00770073003E0031003C002F004E0075006D0052006F00770073003E000A0020002000200020003C004E0075006D0043006F006C0073003E0031003C002F004E0075006D0043006F006C0073003E000A0020002000200020003C00580050006F0073003E0030003C002F00580050006F0073003E000A0020002000200020003C00590050006F0073003E0030003C002F00590050006F0073003E000A0020002000200020003C00530065006C00530074006100720074003E0030003C002F00530065006C00530074006100720074003E000A0020002000200020003C00530065006C0045006E0064003E0030003C002F00530065006C0045006E0064003E000A0020002000200020003C00580050006F00730032003E0030003C002F00580050006F00730032003E000A0020002000200020003C00590050006F00730032003E003100330032003C002F00590050006F00730032003E000A0020002000200020003C00530065006C005300740061007200740032003E0036003000370030003C002F00530065006C005300740061007200740032003E000A0020002000200020003C00530065006C0045006E00640032003E0036003100300032003C002F00530065006C0045006E00640032003E000A003C002F0052006F006F0074003E000A00FFFEFF0970006F0072007400410053004D002E00730000000000FFFFFFFFFFFFFFFF0000000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000100000002000000E101000049000000700D000086040000</MDITabsState>\r
             </MDIClientArea-0>\r
         </MDIWindows>\r
     </WindowStorage>\r
index ec8b6648728c5c0ece194e1a1093230ecadd7483..278fb9f6a37b3925ce6795e98e309c5c596266fb 100644 (file)
                                                                                                \r
                                 <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.other.458885637" name="Other compiler flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>\r
                                                                                                \r
+                                <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otherwarnings.501755172" name="Other warning flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wall -Wextra" valueType="string"/>\r
+                                                                                               \r
+                                <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otheroptimizations.161916863" name="Other optimization flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otheroptimizations" useByScannerDiscovery="true" value="" valueType="string"/>\r
+                                                                                               \r
                                 <inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.1901773760" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input"/>\r
                                                                                        \r
                             </tool>\r
index 199f873dc05573c0d96206679feb817e3185f831..a39d90c9aa7bb7325ae63f90921bb5b23764c793 100644 (file)
@@ -11,7 +11,7 @@
                                \r
             <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>\r
                                \r
-            <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1790871989465787416" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">\r
+            <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-515639860269293471" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">\r
                                                \r
                 <language-scope id="org.eclipse.cdt.core.gcc"/>\r
                                                \r
index 724426b1d5a4e6c7fcd832eb729b88315424a295..79f1a00a1a814ff37e9aa930f7e2c3fa8b87b7d4 100644 (file)
@@ -85,7 +85,6 @@
  *\r
  * See http://www.freertos.org/a00110.html.\r
  *----------------------------------------------------------*/\r
-\r
 #define configCLINT_BASE_ADDRESS               PRCI_BASE\r
 #define configUSE_PREEMPTION                   1\r
 #define configUSE_IDLE_HOOK                            1\r
@@ -143,4 +142,7 @@ to exclude the API function. */
 header file. */\r
 #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); __asm volatile( "ebreak" ); for( ;; ); }\r
 \r
+/* Defined in main.c and used in main_blinky.c and main_full.c. */\r
+void vSendString( const char * const pcString );\r
+\r
 #endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_i2c.c b/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_i2c.c
deleted file mode 100644 (file)
index daa1887..0000000
+++ /dev/null
@@ -1,1563 +0,0 @@
-/*******************************************************************************\r
- * (c) Copyright 2009-2015 Microsemi  SoC Products Group.  All rights reserved.\r
- * \r
- * CoreI2C software driver implementation.\r
- * \r
- * SVN $Revision: 7984 $\r
- * SVN $Date: 2015-10-12 12:07:40 +0530 (Mon, 12 Oct 2015) $\r
- */\r
-#include <stdint.h>\r
-#include <stdlib.h>\r
-#include <stddef.h>\r
-#include <unistd.h>\r
-#include <errno.h>\r
-#include <sys/stat.h>\r
-#include <sys/times.h>\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include "cpu_types.h"\r
-#include "core_smbus_regs.h"\r
-#include "core_i2c.h"\r
-#include "hal.h"\r
-#include "hal_assert.h"\r
-\r
-\r
-#include <string.h>\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C transaction direction.\r
- */\r
-#define WRITE_DIR    0u\r
-#define READ_DIR     1u\r
-\r
-/* -- TRANSACTIONS TYPES -- */\r
-#define NO_TRANSACTION                      0u\r
-#define MASTER_WRITE_TRANSACTION            1u\r
-#define MASTER_READ_TRANSACTION             2u\r
-#define MASTER_RANDOM_READ_TRANSACTION      3u\r
-#define WRITE_SLAVE_TRANSACTION             4u\r
-#define READ_SLAVE_TRANSACTION              5u\r
-\r
-/* -- SMBUS H/W STATES -- */\r
-/* -- MASTER STATES -- */\r
-#define ST_BUS_ERROR        0x00u           /* Bus error during MST or selected slave modes */\r
-#define ST_I2C_IDLE         0xF8u           /* No activity and no interrupt either... */\r
-#define ST_START            0x08u           /* start condition sent */\r
-#define ST_RESTART          0x10u           /* repeated start */\r
-#define ST_SLAW_ACK         0x18u           /* SLA+W sent, ack received */\r
-#define ST_SLAW_NACK        0x20u           /* SLA+W sent, nack received */\r
-#define ST_TX_DATA_ACK      0x28u           /* Data sent, ACK'ed */\r
-#define ST_TX_DATA_NACK     0x30u           /* Data sent, NACK'ed */\r
-#define ST_LOST_ARB         0x38u           /* Master lost arbitration */\r
-#define ST_SLAR_ACK         0x40u           /* SLA+R sent, ACK'ed */\r
-#define ST_SLAR_NACK        0x48u           /* SLA+R sent, NACK'ed */\r
-#define ST_RX_DATA_ACK      0x50u           /* Data received, ACK sent */\r
-#define ST_RX_DATA_NACK     0x58u           /* Data received, NACK sent */\r
-#define ST_RESET_ACTIVATED  0xD0u           /* Master reset is activated */\r
-#define ST_STOP_TRANSMIT    0xE0u           /* Stop has been transmitted */\r
-\r
-/* -- SLAVE STATES -- */\r
-#define ST_SLAVE_SLAW       0x60u           /* SLA+W received */\r
-#define ST_SLAVE_SLAR_ACK   0xA8u           /* SLA+R received, ACK returned */\r
-#define ST_SLV_LA           0x68u           /* Slave lost arbitration */\r
-#define ST_GCA              0x70u           /* GCA received */\r
-#define ST_GCA_LA           0x78u           /* GCA lost arbitration */\r
-#define ST_RDATA            0x80u           /* Data received */\r
-#define ST_SLA_NACK         0x88u           /* Slave addressed, NACK returned */\r
-#define ST_GCA_ACK          0x90u           /* Previously addresses with GCA, data ACKed */\r
-#define ST_GCA_NACK         0x98u           /* GCA addressed, NACK returned */\r
-#define ST_RSTOP            0xA0u           /* Stop received */\r
-#define ST_SLARW_LA         0xB0u           /* Arbitration lost */\r
-#define ST_RACK             0xB8u           /* Byte sent, ACK received */\r
-#define ST_SLAVE_RNACK      0xC0u           /* Byte sent, NACK received */\r
-#define ST_FINAL            0xC8u           /* Final byte sent, ACK received */\r
-#define ST_SLV_RST          0xD8u           /* Slave reset state */\r
-\r
-\r
-/* I2C Channel base offset */\r
-#define CHANNEL_BASE_SHIFT    5u\r
-#define CHANNEL_MASK        0x1E0u\r
-\r
-/*\r
- * Maximum address offset length in slave write-read transactions.\r
- * A maximum of two bytes will be interpreted as address offset within the slave\r
- * tx buffer.\r
- */\r
-#define MAX_OFFSET_LENGTH       2u\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C interrupts control functions implemented "i2c_interrupt.c".\r
- * the implementation of these functions depend on the underlying hardware\r
- * design and how the CoreI2C interrupt line is connected to the system's\r
- * interrupt controller.\r
- */\r
-void I2C_enable_irq( i2c_instance_t * this_i2c );\r
-void I2C_disable_irq( i2c_instance_t * this_i2c );\r
-static void enable_slave_if_required(i2c_instance_t * this_i2c);\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_init()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_init\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    addr_t base_address,\r
-    uint8_t ser_address,\r
-    i2c_clock_divider_t ser_clock_speed\r
-)\r
-{\r
-    psr_t saved_psr;\r
-    uint_fast16_t clock_speed = (uint_fast16_t)ser_clock_speed;\r
-    \r
-    /*\r
-     * We need to disable ints while doing this as there is no guarantee we\r
-     * have not been called already and the ISR is active.\r
-     */\r
-\r
-   saved_psr=HAL_disable_interrupts();\r
-    \r
-    /*\r
-     * Initialize all items of the this_i2c data structure to zero. This\r
-     * initializes all state variables to their init value. It relies on\r
-     * the fact that NO_TRANSACTION, I2C_SUCCESS and I2C_RELEASE_BUS all\r
-     * have an actual value of zero.\r
-     */\r
-    memset(this_i2c, 0, sizeof(i2c_instance_t));\r
-    \r
-    /*\r
-     * Set base address of I2C hardware used by this instance.\r
-     */\r
-    this_i2c->base_address = base_address;\r
-\r
-    /*\r
-     * Update Serial address of the device\r
-     */\r
-    this_i2c->ser_address = ((uint_fast8_t)ser_address << 1u);\r
-    \r
-    /*\r
-     * Configure hardware.\r
-     */\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, ENS1, 0x00); /* Reset I2C hardware. */\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, ENS1, 0x01); /* set enable bit */\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, CR2, ( (clock_speed >> 2) & 0x01) );\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, CR1, ( (clock_speed >> 1) & 0x01) );\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, CR0, ( clock_speed & 0x01) );\r
-\r
-    HAL_set_8bit_reg(this_i2c->base_address, ADDRESS, this_i2c->ser_address);\r
-    HAL_set_8bit_reg(this_i2c->base_address, ADDRESS1, this_i2c->ser_address);\r
-    \r
-    /*\r
-     * Finally safe to enable interrupts.\r
-     */\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-/*------------------------------------------------------------------------------\r
- * I2C_channel_init()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_channel_init\r
-(\r
-    i2c_instance_t * this_i2c_channel,\r
-    i2c_instance_t * this_i2c,\r
-    i2c_channel_number_t channel_number,\r
-    i2c_clock_divider_t ser_clock_speed\r
-)\r
-{\r
-    psr_t saved_psr;\r
-    uint_fast16_t clock_speed = (uint_fast16_t)ser_clock_speed;\r
-    \r
-    HAL_ASSERT(channel_number < I2C_MAX_CHANNELS);\r
-    HAL_ASSERT(I2C_CHANNEL_0 != channel_number);\r
-\r
-    /* \r
-     * Cannot allow channel 0 in this function as we will trash the hardware\r
-     * base address and slave address.\r
-     */\r
-    if ((channel_number < I2C_MAX_CHANNELS) &&\r
-        (I2C_CHANNEL_0 != channel_number))\r
-    {\r
-        /*\r
-         * We need to disable ints while doing this as the hardware should already\r
-         * be active at this stage.\r
-         */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-        /*\r
-         * Initialize channel data.\r
-         */\r
-        memset(this_i2c_channel, 0, sizeof(i2c_instance_t));\r
-        \r
-        this_i2c_channel->base_address =\r
-               ((this_i2c->base_address) & ~((addr_t)CHANNEL_MASK)) \r
-            | (((addr_t)channel_number) << CHANNEL_BASE_SHIFT);\r
-\r
-        this_i2c_channel->ser_address = this_i2c->ser_address;\r
-\r
-        HAL_set_8bit_reg_field(this_i2c_channel->base_address, ENS1, 0x00); /* Reset I2C channel hardware. */\r
-        HAL_set_8bit_reg_field(this_i2c_channel->base_address, ENS1, 0x01); /* set enable bit */\r
-        HAL_set_8bit_reg_field(this_i2c_channel->base_address, CR2, ( (clock_speed >> 2) & 0x01) );\r
-        HAL_set_8bit_reg_field(this_i2c_channel->base_address, CR1, ( (clock_speed >> 1) & 0x01) );\r
-        HAL_set_8bit_reg_field(this_i2c_channel->base_address, CR0, ( clock_speed & 0x01) );\r
-        /*\r
-         * Finally safe to enable interrupts.\r
-         */\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-    }\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_write()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_write\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t serial_addr,\r
-    const uint8_t * write_buffer,\r
-    uint16_t write_size,\r
-    uint8_t options\r
-)\r
-{\r
-    psr_t saved_psr;\r
-    volatile uint8_t stat_ctrl;\r
-\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    /* Update the transaction only when there is no transaction going on I2C */\r
-    if( this_i2c->transaction == NO_TRANSACTION)\r
-    {\r
-      this_i2c->transaction = MASTER_WRITE_TRANSACTION;\r
-    }\r
-\r
-    /* Update the Pending transaction information so that transaction can restarted */\r
-    this_i2c->pending_transaction = MASTER_WRITE_TRANSACTION ;\r
-\r
-    /* Update target address */\r
-    this_i2c->target_addr = (uint_fast8_t)serial_addr << 1u;\r
-    this_i2c->dir = WRITE_DIR;\r
-    this_i2c->master_tx_buffer = write_buffer;\r
-    this_i2c->master_tx_size = write_size;\r
-    this_i2c->master_tx_idx = 0u;\r
-\r
-    /* Set I2C status in progress */\r
-    this_i2c->master_status = I2C_IN_PROGRESS;\r
-    this_i2c->options = options;\r
-\r
-    if(I2C_IN_PROGRESS == this_i2c->slave_status)\r
-    {\r
-        this_i2c->is_transaction_pending = 1u;\r
-    }\r
-    else\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-    }\r
-\r
-    /*\r
-     * Clear interrupts if required (depends on repeated starts).\r
-     * Since the Bus is on hold, only then prior status needs to\r
-     * be cleared.\r
-     */\r
-    if ( I2C_HOLD_BUS == this_i2c->bus_status )\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, SI, 0x00u);\r
-    }\r
-\r
-    stat_ctrl = HAL_get_8bit_reg( this_i2c->base_address, STATUS);\r
-    stat_ctrl = stat_ctrl;  /* Avoids lint warning. */\r
-\r
-    /* Enable the interrupt. ( Re-enable) */\r
-    I2C_enable_irq( this_i2c );\r
-\r
-\r
-       HAL_restore_interrupts(saved_psr);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_read()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_read\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t serial_addr,\r
-    uint8_t * read_buffer,\r
-    uint16_t read_size,\r
-    uint8_t options\r
-)\r
-{\r
-    psr_t saved_psr;\r
-    volatile uint8_t stat_ctrl;\r
-\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-    \r
-    /* Update the transaction only when there is no transaction going on I2C */\r
-    if( this_i2c->transaction == NO_TRANSACTION)\r
-    {\r
-      this_i2c->transaction = MASTER_READ_TRANSACTION;\r
-    }\r
-\r
-    /* Update the Pending transaction information so that transaction can restarted */\r
-    this_i2c->pending_transaction = MASTER_READ_TRANSACTION ;\r
-\r
-    /* Update target address */\r
-    this_i2c->target_addr = (uint_fast8_t)serial_addr << 1u;\r
-\r
-    this_i2c->dir = READ_DIR;\r
-\r
-    this_i2c->master_rx_buffer = read_buffer;\r
-    this_i2c->master_rx_size = read_size;\r
-    this_i2c->master_rx_idx = 0u;\r
-\r
-    /* Set I2C status in progress */\r
-    this_i2c->master_status = I2C_IN_PROGRESS;\r
-\r
-    this_i2c->options = options;\r
-    \r
-    if(I2C_IN_PROGRESS == this_i2c->slave_status)\r
-    {\r
-        this_i2c->is_transaction_pending = 1u;\r
-    }\r
-    else\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-    }\r
-\r
-    /*\r
-     * Clear interrupts if required (depends on repeated starts).\r
-     * Since the Bus is on hold, only then prior status needs to\r
-     * be cleared.\r
-     */\r
-    if ( I2C_HOLD_BUS == this_i2c->bus_status )\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, SI, 0x00u);\r
-    }\r
-\r
-    stat_ctrl = HAL_get_8bit_reg( this_i2c->base_address, STATUS);\r
-    stat_ctrl = stat_ctrl;  /* Avoids lint warning. */\r
-\r
-    /* Enable the interrupt. ( Re-enable) */\r
-    I2C_enable_irq( this_i2c );\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_write_read()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_write_read\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t serial_addr,\r
-    const uint8_t * addr_offset,\r
-    uint16_t offset_size,\r
-    uint8_t * read_buffer,\r
-    uint16_t read_size,\r
-    uint8_t options\r
-)\r
-{\r
-    HAL_ASSERT(offset_size > 0u);\r
-    HAL_ASSERT(addr_offset != (uint8_t *)0);\r
-    HAL_ASSERT(read_size > 0u);\r
-    HAL_ASSERT(read_buffer != (uint8_t *)0);\r
-    \r
-    this_i2c->master_status = I2C_FAILED;\r
-    \r
-    if((read_size > 0u) && (offset_size > 0u))\r
-    {\r
-        psr_t saved_psr;\r
-        volatile uint8_t stat_ctrl;\r
-\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-        /* Update the transaction only when there is no transaction going on I2C */\r
-        if( this_i2c->transaction == NO_TRANSACTION)\r
-        {\r
-            this_i2c->transaction = MASTER_RANDOM_READ_TRANSACTION;\r
-        }\r
-\r
-        /* Update the Pending transaction information so that transaction can restarted */\r
-        this_i2c->pending_transaction = MASTER_RANDOM_READ_TRANSACTION ;\r
-\r
-        /* Update target address */\r
-        this_i2c->target_addr = (uint_fast8_t)serial_addr << 1u;\r
-\r
-        this_i2c->dir = WRITE_DIR;\r
-\r
-        this_i2c->master_tx_buffer = addr_offset;\r
-        this_i2c->master_tx_size = offset_size;\r
-        this_i2c->master_tx_idx = 0u;\r
-\r
-        this_i2c->master_rx_buffer = read_buffer;\r
-        this_i2c->master_rx_size = read_size;\r
-        this_i2c->master_rx_idx = 0u;\r
-        \r
-        /* Set I2C status in progress */\r
-        this_i2c->master_status = I2C_IN_PROGRESS;\r
-        this_i2c->options = options;\r
-        \r
-        if(I2C_IN_PROGRESS == this_i2c->slave_status)\r
-        {\r
-            this_i2c->is_transaction_pending = 1u;\r
-        }\r
-        else\r
-        {\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-        }\r
-\r
-        /*\r
-         * Clear interrupts if required (depends on repeated starts).\r
-         * Since the Bus is on hold, only then prior status needs to\r
-         * be cleared.\r
-         */\r
-        if ( I2C_HOLD_BUS == this_i2c->bus_status )\r
-        {\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, SI, 0x00u);\r
-        }\r
-\r
-        stat_ctrl = HAL_get_8bit_reg( this_i2c->base_address, STATUS);\r
-        stat_ctrl = stat_ctrl;  /* Avoids lint warning. */\r
-            \r
-        /* Enable the interrupt. ( Re-enable) */\r
-        I2C_enable_irq( this_i2c );\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-    }\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_get_status()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-i2c_status_t I2C_get_status\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    i2c_status_t i2c_status ;\r
-\r
-    i2c_status = this_i2c->master_status ;\r
-\r
-    return i2c_status;\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_wait_complete()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-i2c_status_t I2C_wait_complete\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint32_t timeout_ms\r
-)\r
-{\r
-    i2c_status_t i2c_status;\r
-    psr_t saved_psr;\r
-    /*\r
-     * Because we have no idea of what CPU we are supposed to be running on\r
-     * we need to guard this write to the timeout value to avoid ISR/user code\r
-     * interaction issues. Checking the status below should be fine as only a\r
-     * single byte should change in that.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-    this_i2c->master_timeout_ms = timeout_ms;\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-\r
-    /* Run the loop until state returns I2C_FAILED  or I2C_SUCESS*/\r
-    do {\r
-        i2c_status = this_i2c->master_status;\r
-    } while(I2C_IN_PROGRESS == i2c_status);\r
-    return i2c_status;\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_system_tick()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_system_tick\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint32_t ms_since_last_tick\r
-)\r
-{\r
-    if(this_i2c->master_timeout_ms != I2C_NO_TIMEOUT)\r
-    {\r
-       if(this_i2c->master_timeout_ms > ms_since_last_tick)\r
-        {\r
-            this_i2c->master_timeout_ms -= ms_since_last_tick;\r
-        }\r
-        else\r
-        {\r
-            psr_t saved_psr;\r
-            /*\r
-             * We need to disable interrupts here to ensure we can update the\r
-             * shared data without the I2C ISR interrupting us.\r
-             */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-            /*\r
-             * Mark current transaction as having timed out.\r
-             */\r
-            this_i2c->master_status = I2C_TIMED_OUT;\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            this_i2c->is_transaction_pending = 0;\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-            \r
-            /*\r
-             * Make sure we do not incorrectly signal a timeout for subsequent\r
-             * transactions.\r
-             */\r
-            this_i2c->master_timeout_ms = I2C_NO_TIMEOUT;\r
-        }\r
-    }\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_set_slave_tx_buffer()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_set_slave_tx_buffer\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    const uint8_t * tx_buffer,\r
-    uint16_t tx_size\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * shared data without the I2C ISR interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-    \r
-    this_i2c->slave_tx_buffer = tx_buffer;\r
-    this_i2c->slave_tx_size = tx_size;\r
-    this_i2c->slave_tx_idx = 0u;\r
-    \r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_set_slave_rx_buffer()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_set_slave_rx_buffer\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t * rx_buffer,\r
-    uint16_t rx_size\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * shared data without the I2C ISR interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    this_i2c->slave_rx_buffer = rx_buffer;\r
-    this_i2c->slave_rx_size = rx_size;\r
-    this_i2c->slave_rx_idx = 0u;\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_set_slave_mem_offset_length()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_set_slave_mem_offset_length\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t offset_length\r
-)\r
-{\r
-    HAL_ASSERT(offset_length <= MAX_OFFSET_LENGTH);\r
-    \r
-    /*\r
-     * Single byte update, should be interrupt safe\r
-     */\r
-    if(offset_length > MAX_OFFSET_LENGTH)\r
-    {\r
-        this_i2c->slave_mem_offset_length = MAX_OFFSET_LENGTH;\r
-    }\r
-    else\r
-    {\r
-        this_i2c->slave_mem_offset_length = offset_length;\r
-    }\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_register_write_handler()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_register_write_handler\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    i2c_slave_wr_handler_t handler\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * shared data without the I2C ISR interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    this_i2c->slave_write_handler = handler;\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_enable_slave()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_enable_slave\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register and slave mode flag without the I2C ISR interrupting\r
-     * us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    /* Set the Assert Acknowledge bit. */\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x01u);\r
-\r
-    /* Enable slave mode */\r
-    this_i2c->is_slave_enabled = 1u;\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-\r
-    /* Enable I2C IRQ*/\r
-    I2C_enable_irq( this_i2c );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_disable_slave()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_disable_slave\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the I2C ISR interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-    \r
-    /* Reset the assert acknowledge bit. */\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x00u);\r
-\r
-    /* Disable slave mode with IRQ blocked to make whole change atomic */\r
-    this_i2c->is_slave_enabled = 0u;\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * \r
- */\r
-static void enable_slave_if_required\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    /*\r
-     * This function is only called from within the ISR and so does not need\r
-     * guarding on the register access.\r
-     */\r
-    if( 0 != this_i2c->is_slave_enabled )\r
-    {\r
-        HAL_set_8bit_reg_field( this_i2c->base_address, AA, 0x01u );\r
-    }\r
-}\r
-/*------------------------------------------------------------------------------\r
- * I2C_set_slave_second_addr()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_set_slave_second_addr\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t second_slave_addr\r
-)\r
-{\r
-    uint8_t second_slave_address;\r
-    \r
-    /*\r
-      This function does not support CoreI2C hardware configured with a fixed \r
-      second slave address.  The current implementation of the ADDR1[0] register\r
-      bit makes it difficult for the driver to support both programmable and\r
-      fixed second slave address, so we choose to support programmable only.\r
-      With the programmable configuration, ADDR1[0] and ADDR0[0] both control\r
-      enable/disable of GCA recognition, as an effective OR of the 2 bit fields.\r
-      Therefore we set ADDR1[0] to 0 here, so that only ADDR0[0] controls GCA.\r
-     */\r
-    second_slave_address = (uint8_t)((second_slave_addr << 1u) & (~SLAVE1_EN_MASK));\r
-\r
-    /*\r
-     * Single byte register write, should be interrupt safe\r
-     */\r
-    HAL_set_8bit_reg(this_i2c->base_address, ADDRESS1, second_slave_address);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_disable_slave_second_addr()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_disable_slave_second_addr\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    /*\r
-      We are disabling the second slave address by setting the value of the 2nd\r
-      slave address to the primary slave address. The reason for using this method\r
-      of disabling 2nd slave address is that ADDRESS1[0] has different meaning \r
-      depending on hardware configuration. Its use would likely interfere with\r
-      the intended GCA setting.\r
-     */\r
-    /*\r
-     * Single byte register write, should be interrupt safe\r
-     */\r
-    HAL_set_8bit_reg(this_i2c->base_address, ADDRESS1, this_i2c->ser_address);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * i2C_set_gca()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-\r
-void I2C_set_gca\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    /* \r
-     * This read modify write access should be interrupt safe as the address\r
-     * register is not written to in the ISR.\r
-     */\r
-    /* accept GC addressing. */\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, GC, 0x01u);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_clear_gca()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_clear_gca\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    /* \r
-     * This read modify write access should be interrupt safe as the address\r
-     * register is not written to in the ISR.\r
-     */\r
-    /* Clear GC addressing. */\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, GC, 0x00u);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_isr()\r
- * See "core_i2c.h" for details of how to use this function.\r
- */\r
-void I2C_isr\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    volatile uint8_t status;\r
-    uint8_t data;\r
-    uint8_t hold_bus;\r
-    uint8_t clear_irq = 1u;\r
-\r
-    status = HAL_get_8bit_reg( this_i2c->base_address, STATUS);\r
-    \r
-    switch( status )\r
-    {\r
-        /************** MASTER TRANSMITTER / RECEIVER *******************/\r
-      \r
-        case ST_START: /* start has been xmt'd */\r
-        case ST_RESTART: /* repeated start has been xmt'd */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            HAL_set_8bit_reg_field( this_i2c->base_address, STA, 0x00u);\r
-            HAL_set_8bit_reg( this_i2c->base_address, DATA, this_i2c->target_addr); /* write call address */\r
-            HAL_set_8bit_reg_field( this_i2c->base_address, DIR, this_i2c->dir); /* set direction bit */\r
-            if(this_i2c->dir == WRITE_DIR)\r
-            {\r
-                 this_i2c->master_tx_idx = 0u;\r
-            }\r
-            else\r
-            {\r
-                 this_i2c->master_rx_idx = 0u;\r
-            }\r
-\r
-            /*\r
-             * Clear the pending transaction. This condition will be true if the slave \r
-             * has acquired the bus to carry out pending master transaction which \r
-             * it had received during its slave transmission or reception mode. \r
-             */\r
-            if(this_i2c->is_transaction_pending)\r
-            {\r
-                this_i2c->is_transaction_pending = 0u;\r
-            }\r
-\r
-            /*\r
-             * Make sure to update proper transaction after master START\r
-             * or RESTART\r
-             */\r
-            if(this_i2c->transaction != this_i2c->pending_transaction)\r
-            {\r
-                this_i2c->transaction = this_i2c->pending_transaction;\r
-            }\r
-            break;\r
-            \r
-        case ST_LOST_ARB:\r
-              /* Set start bit.  Let's keep trying!  Don't give up! */\r
-              HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-              break;\r
-\r
-        case ST_STOP_TRANSMIT:\r
-             /* Stop has been transmitted. Do nothing */\r
-              break;\r
-\r
-        /******************* MASTER TRANSMITTER *************************/\r
-        case ST_SLAW_NACK:\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /* SLA+W has been transmitted; not ACK has been received - let's stop. */\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, STO, 0x01u);\r
-            this_i2c->master_status = I2C_FAILED;\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            enable_slave_if_required(this_i2c);\r
-            break;\r
-            \r
-        case ST_SLAW_ACK:\r
-        case ST_TX_DATA_ACK:\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /* data byte has been xmt'd with ACK, time to send stop bit or repeated start. */\r
-            if (this_i2c->master_tx_idx < this_i2c->master_tx_size)\r
-            {    \r
-                HAL_set_8bit_reg(this_i2c->base_address, DATA, (uint_fast8_t)this_i2c->master_tx_buffer[this_i2c->master_tx_idx++]);\r
-            }\r
-            else if ( this_i2c->transaction == MASTER_RANDOM_READ_TRANSACTION )\r
-            {\r
-                /* We are finished sending the address offset part of a random read transaction.\r
-                 * It is is time to send a restart in order to change direction. */\r
-                 this_i2c->dir = READ_DIR;\r
-                 HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-            }\r
-            else /* done sending. let's stop */\r
-            {\r
-                /*\r
-                 * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-                 * transaction\r
-                 */\r
-                this_i2c->transaction = NO_TRANSACTION;\r
-                hold_bus = this_i2c->options & I2C_HOLD_BUS;\r
-\r
-                /* Store the information of current I2C bus status in the bus_status*/\r
-                this_i2c->bus_status  = hold_bus;\r
-                if ( hold_bus == 0u )\r
-                { \r
-                    HAL_set_8bit_reg_field(this_i2c->base_address, STO, 0x01u);  /*xmt stop condition */\r
-                    enable_slave_if_required(this_i2c);\r
-                }\r
-                else\r
-                {\r
-                    I2C_disable_irq( this_i2c );\r
-                    clear_irq = 0u;\r
-                }\r
-                this_i2c->master_status = I2C_SUCCESS;\r
-            }\r
-            break;\r
-\r
-          case ST_TX_DATA_NACK:\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /* data byte SENT, ACK to be received\r
-             * In fact, this means we've received a NACK (This may not be \r
-             * obvious, but if we've rec'd an ACK then we would be in state \r
-             * 0x28!) hence, let's send a stop bit\r
-             */\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, STO, 0x01u);/* xmt stop condition */\r
-            this_i2c->master_status = I2C_FAILED;\r
-\r
-            /*\r
-             * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-             * transaction\r
-             */\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            enable_slave_if_required(this_i2c);\r
-            break;\r
-              \r
-      /********************* MASTER (or slave?) RECEIVER *************************/\r
-      \r
-      /* STATUS codes 08H, 10H, 38H are all covered in MTX mode */\r
-        case ST_SLAR_ACK: /* SLA+R tx'ed. */\r
-//         //write_hex(STDOUT_FILENO, status);\r
-            /* Let's make sure we ACK the first data byte received (set AA bit in CTRL) unless\r
-             * the next byte is the last byte of the read transaction.\r
-             */\r
-            if(this_i2c->master_rx_size > 1u)\r
-            {\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x01u);\r
-            }\r
-            else if(1u == this_i2c->master_rx_size)\r
-            {\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x00u);\r
-            }\r
-            else /* this_i2c->master_rx_size == 0u */\r
-            {\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x01u);\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, STO, 0x01u);\r
-                this_i2c->master_status = I2C_SUCCESS;\r
-                this_i2c->transaction = NO_TRANSACTION;\r
-            }\r
-            break;\r
-            \r
-        case ST_SLAR_NACK: /* SLA+R tx'ed; let's release the bus (send a stop condition) */\r
-//         //write_hex(STDOUT_FILENO, status);\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, STO, 0x01u);\r
-            this_i2c->master_status = I2C_FAILED;\r
-\r
-            /*\r
-             * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-             * transaction\r
-             */\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            enable_slave_if_required(this_i2c);\r
-            break;\r
-          \r
-        case ST_RX_DATA_ACK: /* Data byte received, ACK returned */\r
-//         //write_hex(STDOUT_FILENO, status);\r
-            /* First, get the data */\r
-            this_i2c->master_rx_buffer[this_i2c->master_rx_idx++] = HAL_get_8bit_reg(this_i2c->base_address, DATA);\r
-            if( this_i2c->master_rx_idx >= (this_i2c->master_rx_size - 1u))\r
-            {\r
-                /* If we're at the second last byte, let's set AA to 0 so\r
-                 * we return a NACK at the last byte. */\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x00u);\r
-            }\r
-            break;\r
-            \r
-        case ST_RX_DATA_NACK: /* Data byte received, NACK returned */\r
-//         //write_hex(STDOUT_FILENO, status);\r
-            /* Get the data, then send a stop condition */\r
-            this_i2c->master_rx_buffer[this_i2c->master_rx_idx] = HAL_get_8bit_reg(this_i2c->base_address, DATA);\r
-          \r
-            hold_bus = this_i2c->options & I2C_HOLD_BUS; \r
-\r
-            /* Store the information of current I2C bus status in the bus_status*/\r
-            this_i2c->bus_status  = hold_bus;\r
-            if ( hold_bus == 0u )\r
-            { \r
-                HAL_set_8bit_reg_field(this_i2c->base_address, STO, 0x01u);  /*xmt stop condition */\r
-\r
-                /* Bus is released, now we can start listening to bus, if it is slave */\r
-                   enable_slave_if_required(this_i2c);\r
-            }\r
-            else\r
-            {\r
-                I2C_disable_irq( this_i2c );\r
-                clear_irq = 0u;\r
-            }\r
-            /*\r
-             * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-             * transaction\r
-             */\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            this_i2c->master_status = I2C_SUCCESS;\r
-            break;\r
-        \r
-        /******************** SLAVE RECEIVER **************************/\r
-        case ST_GCA_NACK: /* NACK after, GCA addressing */\r
-        case ST_SLA_NACK: /* Re-enable AA (assert ack) bit for future transmissions */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x01u);\r
-\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            this_i2c->slave_status = I2C_SUCCESS;\r
-            \r
-            /* Check if transaction was pending. If yes, set the START bit */\r
-            if(this_i2c->is_transaction_pending)\r
-            {\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-            }\r
-            break;\r
-            \r
-        case ST_GCA_LA: /* Arbitr. lost (GCA rec'd) */\r
-        case ST_SLV_LA: /* Arbitr. lost (SLA rec'd) */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /*\r
-             *  We lost arbitration and either the GCE or our address was the\r
-             *  one received so pend the master operation we were starting.\r
-             */\r
-            this_i2c->is_transaction_pending = 1u;\r
-            /* Fall through to normal ST processing as we are now in slave mode */\r
-\r
-        case ST_GCA: /* General call address received, ACK returned */\r
-        case ST_SLAVE_SLAW: /* SLA+W received, ACK returned */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            this_i2c->transaction = WRITE_SLAVE_TRANSACTION;\r
-            this_i2c->slave_rx_idx = 0u;\r
-            this_i2c->random_read_addr = 0u;\r
-            /*\r
-             * If Start Bit is set clear it, but store that information since it is because of\r
-             * pending transaction\r
-             */\r
-            if(HAL_get_8bit_reg_field(this_i2c->base_address, STA))\r
-            {\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x00u);\r
-                this_i2c->is_transaction_pending = 1u;\r
-            }\r
-            this_i2c->slave_status = I2C_IN_PROGRESS;\r
-#ifdef INCLUDE_SLA_IN_RX_PAYLOAD\r
-            /* Fall through to put address as first byte in payload buffer */\r
-#else\r
-            /* Only break from this case if the slave address must NOT be included at the\r
-             * beginning of the received write data. */\r
-            break;\r
-#endif            \r
-        case ST_GCA_ACK: /* DATA received; ACK sent after GCA */\r
-        case ST_RDATA: /* DATA received; must clear DATA register */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            if((this_i2c->slave_rx_buffer != (uint8_t *)0)\r
-               && (this_i2c->slave_rx_idx < this_i2c->slave_rx_size))\r
-            {\r
-                data = HAL_get_8bit_reg(this_i2c->base_address, DATA);\r
-                this_i2c->slave_rx_buffer[this_i2c->slave_rx_idx++] = data;\r
-                \r
-#ifdef INCLUDE_SLA_IN_RX_PAYLOAD\r
-                if((ST_RDATA == status) || (ST_GCA_ACK == status))\r
-                {\r
-                    /* Ignore the slave address byte in the random read address\r
-                       computation in the case where INCLUDE_SLA_IN_RX_PAYLOAD\r
-                       is defined. */\r
-#endif\r
-                    this_i2c->random_read_addr = (this_i2c->random_read_addr << 8) + data;\r
-#ifdef INCLUDE_SLA_IN_RX_PAYLOAD\r
-                }\r
-#endif\r
-            }\r
-            \r
-            if(this_i2c->slave_rx_idx >= this_i2c->slave_rx_size)\r
-            {\r
-                /* Rx buffer is full. NACK next received byte. */\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x00u); \r
-            }\r
-            break;\r
-            \r
-        case ST_RSTOP:\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /* STOP or repeated START occurred. */\r
-            /* We cannot be sure if the transaction has actually completed as\r
-             * this hardware state reports that either a STOP or repeated START\r
-             * condition has occurred. We assume that this is a repeated START\r
-             * if the transaction was a write from the master to this point.*/\r
-            if ( this_i2c->transaction == WRITE_SLAVE_TRANSACTION )\r
-            {\r
-                if ( this_i2c->slave_rx_idx == this_i2c->slave_mem_offset_length )\r
-                {\r
-                    this_i2c->slave_tx_idx = this_i2c->random_read_addr;\r
-                }\r
-                /* Call the slave's write transaction handler if it exists. */\r
-                if ( this_i2c->slave_write_handler != 0u )\r
-                {\r
-                    i2c_slave_handler_ret_t h_ret;\r
-                    h_ret = this_i2c->slave_write_handler( this_i2c, this_i2c->slave_rx_buffer, (uint16_t)this_i2c->slave_rx_idx );\r
-                    if ( I2C_REENABLE_SLAVE_RX == h_ret )\r
-                    {\r
-                        /* There is a small risk that the write handler could\r
-                         * call I2C_disable_slave() but return\r
-                         * I2C_REENABLE_SLAVE_RX in error so we only enable\r
-                         * ACKs if still in slave mode. */\r
-                         enable_slave_if_required(this_i2c);\r
-                    }\r
-                    else\r
-                    {\r
-                        HAL_set_8bit_reg_field( this_i2c->base_address, AA, 0x0u );\r
-                        /* Clear slave mode flag as well otherwise in mixed\r
-                         * master/slave applications, the AA bit will get set by\r
-                         * subsequent master operations. */\r
-                        this_i2c->is_slave_enabled = 0u;\r
-                    }\r
-                }\r
-                else\r
-                {\r
-                    /* Re-enable address acknowledge in case we were ready to nack the next received byte. */\r
-                    HAL_set_8bit_reg_field( this_i2c->base_address, AA, 0x01u );\r
-                }\r
-            }\r
-            else /* A stop or repeated start outside a write/read operation */\r
-            {\r
-                /*\r
-                 * Reset slave_tx_idx so that a subsequent read will result in the slave's\r
-                 * transmit buffer being sent from the first byte.\r
-                 */\r
-                this_i2c->slave_tx_idx = 0u;\r
-                /*\r
-                 * See if we need to re-enable acknowledgement as some error conditions, such\r
-                 * as a master prematurely ending a transfer, can see us get here with AA set\r
-                 * to 0 which will disable slave operation if we are not careful.\r
-                 */\r
-                enable_slave_if_required(this_i2c);\r
-            }\r
-\r
-            /* Mark any previous master write transaction as complete. */\r
-            this_i2c->slave_status = I2C_SUCCESS;\r
-            \r
-            /* Check if transaction was pending. If yes, set the START bit */\r
-            if(this_i2c->is_transaction_pending)\r
-            {\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-            }\r
-\r
-            /*\r
-             * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-             * transaction\r
-             */\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-\r
-            break;\r
-            \r
-        case ST_SLV_RST: /* SMBUS ONLY: timeout state. must clear interrupt */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /*\r
-             * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-             * transaction.\r
-             */\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            /*\r
-             * Reset slave_tx_idx so that a subsequent read will result in the slave's\r
-             * transmit buffer being sent from the first byte.\r
-             */\r
-            this_i2c->slave_tx_idx = 0u;\r
-            /*\r
-             * Clear status to I2C_FAILED only if there was an operation in progress.\r
-             */\r
-            if(I2C_IN_PROGRESS == this_i2c->slave_status)\r
-            {\r
-                this_i2c->slave_status = I2C_FAILED;\r
-            }\r
-\r
-            enable_slave_if_required(this_i2c); /* Make sure AA is set correctly */\r
-\r
-            break;\r
-            \r
-        /****************** SLAVE TRANSMITTER **************************/\r
-        case ST_SLAVE_SLAR_ACK: /* SLA+R received, ACK returned */\r
-        case ST_SLARW_LA:       /* Arbitration lost, and: */\r
-        case ST_RACK:           /* Data tx'ed, ACK received */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            if ( status == ST_SLAVE_SLAR_ACK )\r
-            {\r
-                this_i2c->transaction = READ_SLAVE_TRANSACTION;\r
-                this_i2c->random_read_addr = 0u;\r
-                this_i2c->slave_status = I2C_IN_PROGRESS;\r
-                /* If Start Bit is set clear it, but store that information since it is because of\r
-                 * pending transaction\r
-                 */\r
-                if(HAL_get_8bit_reg_field(this_i2c->base_address, STA))\r
-                {\r
-                    HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x00u);\r
-                    this_i2c->is_transaction_pending = 1u;\r
-                 }\r
-            }\r
-            if (this_i2c->slave_tx_idx >= this_i2c->slave_tx_size)\r
-            {\r
-                /* Ensure 0xFF is returned to the master when the slave specifies\r
-                 * an empty transmit buffer. */\r
-                HAL_set_8bit_reg(this_i2c->base_address, DATA, 0xFFu);\r
-            }\r
-            else\r
-            {\r
-                /* Load the data the data byte to be sent to the master. */\r
-                HAL_set_8bit_reg(this_i2c->base_address, DATA, (uint_fast8_t)this_i2c->slave_tx_buffer[this_i2c->slave_tx_idx++]);\r
-            }\r
-            /* Determine if this is the last data byte to send to the master. */\r
-            if (this_i2c->slave_tx_idx >= this_i2c->slave_tx_size) /* last byte? */\r
-            {\r
-                 HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x00u); \r
-                /* Next read transaction will result in slave's transmit buffer\r
-                 * being sent from the first byte. */\r
-                this_i2c->slave_tx_idx = 0u;\r
-            }\r
-            break;\r
-        \r
-        case ST_SLAVE_RNACK:    /* Data byte has been transmitted; not-ACK has been received. */\r
-        case ST_FINAL: /* Last Data byte tx'ed, ACK received */\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /* We assume that the transaction will be stopped by the master.\r
-             * Reset slave_tx_idx so that a subsequent read will result in the slave's\r
-             * transmit buffer being sent from the first byte. */\r
-            this_i2c->slave_tx_idx = 0u;\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, AA, 0x01u); \r
-\r
-            /*  Mark previous state as complete */\r
-            this_i2c->slave_status = I2C_SUCCESS;\r
-            /* Check if transaction was pending. If yes, set the START bit */\r
-            if(this_i2c->is_transaction_pending)\r
-            {\r
-                HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x01u);\r
-            }\r
-            /*\r
-             * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-             * transaction\r
-             */\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-\r
-            break;\r
-\r
-        /* Master Reset has been activated Wait 35 ms for interrupt to be set,\r
-         * clear interrupt and proceed to 0xF8 state. */\r
-        case ST_RESET_ACTIVATED:\r
-        case ST_BUS_ERROR: /* Bus error during MST or selected slave modes */\r
-        default:\r
-           //write_hex(STDOUT_FILENO, status);\r
-            /* Some undefined state has encountered. Clear Start bit to make\r
-             * sure, next good transaction happen */\r
-            HAL_set_8bit_reg_field(this_i2c->base_address, STA, 0x00u);\r
-            /*\r
-             * Set the transaction back to NO_TRANSACTION to allow user to do further\r
-             * transaction.\r
-             */\r
-            this_i2c->transaction = NO_TRANSACTION;\r
-            /*\r
-             * Reset slave_tx_idx so that a subsequent read will result in the slave's\r
-             * transmit buffer being sent from the first byte.\r
-             */\r
-            this_i2c->slave_tx_idx = 0u;\r
-            /*\r
-             * Clear statuses to I2C_FAILED only if there was an operation in progress.\r
-             */\r
-            if(I2C_IN_PROGRESS == this_i2c->master_status)\r
-            {\r
-                this_i2c->master_status = I2C_FAILED;\r
-            }\r
-\r
-            if(I2C_IN_PROGRESS == this_i2c->slave_status)\r
-            {\r
-                this_i2c->slave_status = I2C_FAILED;\r
-            }\r
-\r
-            break;\r
-    }\r
-    \r
-    if ( clear_irq )\r
-    {\r
-        /* clear interrupt. */\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, SI, 0x00u);\r
-    }\r
-    \r
-    /* Read the status register to ensure the last I2C registers write took place\r
-     * in a system built around a bus making use of posted writes. */\r
-//    status = HAL_get_8bit_reg( this_i2c->base_address, STATUS);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_smbus_init()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
\r
-/*\r
- * SMBSUS_NO    = 1\r
- * SMBALERT_NO  = 1\r
- * SMBus enable = 1\r
- */\r
-#define INIT_AND_ENABLE_SMBUS   0x54u\r
-void I2C_smbus_init\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    /*\r
-     * Single byte register write, should be interrupt safe\r
-     */\r
-    /* Enable SMBUS */\r
-    HAL_set_8bit_reg(this_i2c->base_address, SMBUS, INIT_AND_ENABLE_SMBUS);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_enable_smbus_irq()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_enable_smbus_irq\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t  irq_type\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the SMBUS IRQs interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    if ( irq_type & I2C_SMBALERT_IRQ)\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, SMBALERT_IE, 0x01u);\r
-    }\r
-    if ( irq_type & I2C_SMBSUS_IRQ)\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, SMBSUS_IE, 0x01u);\r
-    }\r
-    \r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_disable_smbus_irq()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_disable_smbus_irq\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    uint8_t  irq_type\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the SMBUS IRQs interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    if ( irq_type & I2C_SMBALERT_IRQ)\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, SMBALERT_IE, 0x00u);\r
-    }\r
-    if (irq_type & I2C_SMBSUS_IRQ )\r
-    {\r
-        HAL_set_8bit_reg_field(this_i2c->base_address, SMBSUS_IE, 0x00u);\r
-    }\r
-    \r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_suspend_smbus_slave()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_suspend_smbus_slave\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the SMBUS IRQs interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, SMBSUS_NO_CONTROL, 0x00u);\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_resume_smbus_slave()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_resume_smbus_slave\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the SMBUS IRQs interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, SMBSUS_NO_CONTROL, 0x01u);\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_reset_smbus()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_reset_smbus\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the SMBUS IRQs interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, SMBUS_MST_RESET, 0x01u);\r
-    \r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_set_smbus_alert()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_set_smbus_alert\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the SMBUS IRQs interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, SMBALERT_NO_CONTROL, 0x00u);\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_clear_smbus_alert()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_clear_smbus_alert\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    psr_t saved_psr;\r
-\r
-    /*\r
-     * We need to disable interrupts here to ensure we can update the\r
-     * hardware register without the SMBUS IRQs interrupting us.\r
-     */\r
-\r
-       saved_psr=HAL_disable_interrupts();\r
-\r
-    HAL_set_8bit_reg_field(this_i2c->base_address, SMBALERT_NO_CONTROL, 0x01u);\r
-\r
-\r
-       HAL_restore_interrupts( saved_psr );\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_get_irq_status()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-uint8_t I2C_get_irq_status\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    uint8_t status ;\r
-    uint8_t irq_type = I2C_NO_IRQ ;\r
-\r
-    status = HAL_get_8bit_reg(this_i2c->base_address, SMBUS);\r
-\r
-    if( status & (uint8_t)SMBALERT_NI_STATUS_MASK )\r
-    {\r
-        irq_type |= I2C_SMBALERT_IRQ ;\r
-    }\r
-\r
-    if( status & (uint8_t)SMBSUS_NI_STATUS_MASK )\r
-    {\r
-        irq_type |= I2C_SMBSUS_IRQ ;\r
-    }\r
-\r
-    status = HAL_get_8bit_reg(this_i2c->base_address, CONTROL);\r
-\r
-    if( status & (uint8_t)SI_MASK )\r
-    {\r
-        irq_type |= I2C_INTR_IRQ ;\r
-    }\r
-    return(irq_type);\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_set_slave_addr2()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void I2C_set_user_data\r
-(\r
-    i2c_instance_t * this_i2c,\r
-    void * p_user_data\r
-)\r
-{\r
-    this_i2c->p_user_data = p_user_data ;\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * I2C_get_user_data()\r
- * See "i2c.h" for details of how to use this function.\r
- */\r
-void * I2C_get_user_data\r
-(\r
-    i2c_instance_t * this_i2c\r
-)\r
-{\r
-    return( this_i2c->p_user_data);\r
-}\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
diff --git a/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/drivers/CoreI2C/i2c_interrupt.c b/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/drivers/CoreI2C/i2c_interrupt.c
deleted file mode 100644 (file)
index f918b8c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************\r
- * (c) Copyright 2009-2015 Microsemi SoC Products Group.  All rights reserved.\r
- * \r
- * CoreI2C driver interrupt control.\r
- * \r
- * SVN $Revision: 7984 $\r
- * SVN $Date: 2015-10-12 12:07:40 +0530 (Mon, 12 Oct 2015) $\r
- */\r
-#include "hal.h"\r
-#include "hal_assert.h"\r
-#include "core_i2c.h"\r
-#include "riscv_hal.h"\r
-\r
-\r
-#define I2C_IRQn                                           External_29_IRQn\r
-\r
-/*------------------------------------------------------------------------------\r
- * This function must be modified to enable interrupts generated from the\r
- * CoreI2C instance identified as parameter.\r
- */\r
-void I2C_enable_irq( i2c_instance_t * this_i2c )\r
-{\r
-       PLIC_EnableIRQ(I2C_IRQn);\r
-//    HAL_ASSERT(0)\r
-}\r
-\r
-/*------------------------------------------------------------------------------\r
- * This function must be modified to disable interrupts generated from the\r
- * CoreI2C instance identified as parameter.\r
- */\r
-void I2C_disable_irq( i2c_instance_t * this_i2c )\r
-{\r
-       PLIC_DisableIRQ(I2C_IRQn);\r
-//    HAL_ASSERT(0)\r
-}\r
diff --git a/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/riscv_hal/syscall.c b/FreeRTOS/Demo/RISC-V_Renode_Emulator_SoftConsole/Microsemi_Code/riscv_hal/syscall.c
deleted file mode 100644 (file)
index 4c99f80..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************\r
- * (c) Copyright 2016-2018 Microsemi SoC Products Group.  All rights reserved.\r
- *\r
- * @file syscall.c\r
- * @author Microsemi SoC Products Group\r
- * @brief Stubs for system calls.\r
- *\r
- * SVN $Revision: 9661 $\r
- * SVN $Date: 2018-01-15 16:13:33 +0530 (Mon, 15 Jan 2018) $\r
- */\r
-#include <stdint.h>\r
-#include <stdlib.h>\r
-#include <stddef.h>\r
-#include <unistd.h>\r
-#include <errno.h>\r
-#include <sys/stat.h>\r
-#include <sys/times.h>\r
-#include <stdio.h>\r
-#include <string.h>\r
-\r
-#include "encoding.h"\r
-\r
-#ifdef MSCC_STDIO_THRU_CORE_UART_APB\r
-\r
-#include "core_uart_apb.h"\r
-#include "hw_platform.h"\r
-\r
-#endif  /*MSCC_STDIO_THRU_CORE_UART_APB*/\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-#ifdef MSCC_STDIO_THRU_CORE_UART_APB\r
-\r
-/*------------------------------------------------------------------------------\r
- * CoreUARTapb instance data for the CoreUARTapb instance used for standard\r
- * output.\r
- */\r
-static UART_instance_t g_stdio_uart;\r
-\r
-/*==============================================================================\r
- * Flag used to indicate if the UART driver needs to be initialized.\r
- */\r
-static int g_stdio_uart_init_done = 0;\r
-#endif /*MSCC_STDIO_THRU_CORE_UART_APB*/\r
-\r
-#undef errno\r
-int errno;\r
-\r
-char *__env[1] = { 0 };\r
-char **environ = __env;\r
-\r
-void write_hex(int fd, uint32_t hex)\r
-{\r
-    uint8_t ii;\r
-    uint8_t jj;\r
-    char towrite;\r
-    uint8_t digit;\r
-\r
-    write( fd , "0x", 2 );\r
-\r
-    for (ii = 8 ; ii > 0; ii--)\r
-    {\r
-        jj = ii-1;\r
-        digit = ((hex & (0xF << (jj*4))) >> (jj*4));\r
-        towrite = digit < 0xA ? ('0' + digit) : ('A' +  (digit - 0xA));\r
-        write( fd, &towrite, 1);\r
-    }\r
-}\r
-\r
-               \r
-void _exit(int code)\r
-{\r
-#ifdef MSCC_STDIO_THRU_CORE_UART_APB\r
-    const char * message = "\nProgam has exited with code:";\r
-\r
-    write(STDERR_FILENO, message, strlen(message));\r
-    write_hex(STDERR_FILENO, code);\r
-#endif\r
-\r
-    while (1);\r
-}\r
-\r
-void *_sbrk(ptrdiff_t incr)\r
-{\r
-    extern char _end[];\r
-    extern char _heap_end[];\r
-    static char *curbrk = _end;\r
-\r
-    if ((curbrk + incr < _end) || (curbrk + incr > _heap_end))\r
-    {\r
-        return ((char *) - 1);\r
-    }\r
-\r
-    curbrk += incr;\r
-    return curbrk - incr;\r
-}\r
-\r
-int _isatty(int fd)\r
-{\r
-    if (fd == STDOUT_FILENO || fd == STDERR_FILENO)\r
-    {\r
-        return 1;\r
-    }\r
-\r
-    errno = EBADF;\r
-    return 0;\r
-}\r
-\r
-static int stub(int err)\r
-{\r
-    errno = err;\r
-    return -1;\r
-}\r
-\r
-int _open(const char* name, int flags, int mode)\r
-{\r
-    return stub(ENOENT);\r
-}\r
-\r
-int _openat(int dirfd, const char* name, int flags, int mode)\r
-{\r
-    return stub(ENOENT);\r
-}\r
-\r
-int _close(int fd)\r
-{\r
-    return stub(EBADF);\r
-}\r
-\r
-int _execve(const char* name, char* const argv[], char* const env[])\r
-{\r
-    return stub(ENOMEM);\r
-}\r
-\r
-int _fork()\r
-{\r
-    return stub(EAGAIN);\r
-}\r
-\r
-int _fstat(int fd, struct stat *st)\r
-{\r
-    if (isatty(fd))\r
-    {\r
-        st->st_mode = S_IFCHR;\r
-        return 0;\r
-    }\r
-\r
-    return stub(EBADF);\r
-}\r
-\r
-int _getpid()\r
-{\r
-    return 1;\r
-}\r
-\r
-int _kill(int pid, int sig)\r
-{\r
-    return stub(EINVAL);\r
-}\r
-\r
-int _link(const char *old_name, const char *new_name)\r
-{\r
-    return stub(EMLINK);\r
-}\r
-\r
-off_t _lseek(int fd, off_t ptr, int dir)\r
-{\r
-    if (_isatty(fd))\r
-    {\r
-        return 0;\r
-    }\r
-\r
-    return stub(EBADF);\r
-}\r
-\r
-ssize_t _read(int fd, void* ptr, size_t len)\r
-{\r
-#ifdef MSCC_STDIO_THRU_CORE_UART_APB\r
-    if (_isatty(fd))\r
-    {\r
-        /*--------------------------------------------------------------------------\r
-        * Initialize the UART driver if it is the first time this function is\r
-        * called.\r
-        */\r
-        if ( !g_stdio_uart_init_done )\r
-        {\r
-            /******************************************************************************\r
-            * Baud value:\r
-            * This value is calculated using the following equation:\r
-            *      BAUD_VALUE = (CLOCK / (16 * BAUD_RATE)) - 1\r
-            *****************************************************************************/\r
-            UART_init( &g_stdio_uart, MSCC_STDIO_UART_BASE_ADDR, ((SYS_CLK_FREQ/(16 * MSCC_STDIO_BAUD_VALUE))-1), (DATA_8_BITS | NO_PARITY));\r
-            g_stdio_uart_init_done = 1;\r
-        }\r
-\r
-        return UART_get_rx(&g_stdio_uart, (uint8_t*) ptr, len);\r
-    }\r
-#endif\r
-\r
-    return stub(EBADF);\r
-}\r
-\r
-int _stat(const char* file, struct stat* st)\r
-{\r
-    return stub(EACCES);\r
-}\r
-\r
-clock_t _times(struct tms* buf)\r
-{\r
-    return stub(EACCES);\r
-}\r
-\r
-int _unlink(const char* name)\r
-{\r
-    return stub(ENOENT);\r
-}\r
-\r
-int _wait(int* status)\r
-{\r
-    return stub(ECHILD);\r
-}\r
-\r
-ssize_t _write(int fd, const void* ptr, size_t len)\r
-{\r
-\r
-#ifdef MSCC_STDIO_THRU_CORE_UART_APB\r
-  const uint8_t * current = (const uint8_t *) ptr;\r
-  size_t jj;\r
-\r
-  if (_isatty(fd))\r
-  {\r
-        /*--------------------------------------------------------------------------\r
-        * Initialize the UART driver if it is the first time this function is\r
-        * called.\r
-        */\r
-        if ( !g_stdio_uart_init_done )\r
-        {\r
-            /******************************************************************************\r
-            * Baud value:\r
-            * This value is calculated using the following equation:\r
-            *      BAUD_VALUE = (CLOCK / (16 * BAUD_RATE)) - 1\r
-            *****************************************************************************/\r
-            UART_init( &g_stdio_uart, MSCC_STDIO_UART_BASE_ADDR, ((SYS_CLK_FREQ/(16 * MSCC_STDIO_BAUD_VALUE))-1), (DATA_8_BITS | NO_PARITY));\r
-            g_stdio_uart_init_done = 1;\r
-        }\r
-\r
-    for (jj = 0; jj < len; jj++)\r
-    {\r
-        UART_send(&g_stdio_uart, current + jj, 1);\r
-        if (current[jj] == '\n')\r
-        {\r
-            UART_send(&g_stdio_uart, (const uint8_t *)"\r", 1);\r
-        }\r
-    }\r
-    return len;\r
-  }\r
-#endif\r
-\r
-  return stub(EBADF);\r
-}\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
index 68440c85cd2548c1dded0b7ac5933b94f20b2ff3..303baf1938036cab9fdc25f3cdce595ac6a66364 100644 (file)
@@ -175,7 +175,6 @@ unsigned long ulReceivedValue;
 const unsigned long ulExpectedValue = 100UL;\r
 const char * const pcPassMessage = "Blink\r\n";\r
 const char * const pcFailMessage = "Unexpected value received\r\n";\r
-extern void vSendString( const char * const pcString );\r
 extern void vToggleLED( void );\r
 \r
        /* Remove compiler warning about unused parameter. */\r
index 0bd63ebf2b07a596164637231b511d5ff756d849..276b15e62b3b179fcf03600f9448a8a2ec42a120 100644 (file)
@@ -230,7 +230,6 @@ uint32_t ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
 uint32_t ulLastTimer0Interrupts = 0, ulLastTimer1Interrupts = 0;\r
 char * const pcPassMessage = ".";\r
 char * pcStatusMessage = pcPassMessage;\r
-extern void vSendString( const char * const pcString );\r
 extern void vToggleLED( void );\r
 \r
        /* Just to stop compiler warnings. */\r
index 1225598ea0606064c2b8b97d4872baf5384bd396..d8923ac5bd2a1f7781eb3a8aa6d54ddc51ed8582 100644 (file)
@@ -121,7 +121,7 @@ static uint32_t ulLEDState = 0;
 \r
 void vSendString( const char * const pcString )\r
 {\r
-       UART_polled_tx_string( &g_uart, pcString );\r
+       UART_polled_tx_string( &g_uart, ( const uint8_t * ) pcString );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -181,5 +181,13 @@ void vApplicationTickHook( void )
        }\r
        #endif\r
 }\r
+/*-----------------------------------------------------------*/\r
 \r
+void *_sbrk( ptrdiff_t incr )\r
+{\r
+       /* Required to link, but force an assert to ensure it is never actually\r
+       called. */\r
+       configASSERT( ( void * ) incr == NULL );\r
+       return NULL;\r
+}\r
 \r
index 05fa8fdd17dc177d2850b39d4630adbbf981ae12..c0a342247959624afa74372d980c5188600befd1 100644 (file)
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
index 2dca61617bfaf59be28b5301c14e7ddfc7d52a88..1acd4555b2c24f642517a81c48ac67ebed507322 100644 (file)
@@ -45,7 +45,7 @@
 #define configUSE_IDLE_HOOK                                            1\r
 #define configUSE_TICK_HOOK                                            1\r
 #define configUSE_DAEMON_TASK_STARTUP_HOOK             1\r
-#define configTICK_RATE_HZ                                             ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
+#define configTICK_RATE_HZ                                             ( 100 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
 #define configMINIMAL_STACK_SIZE                               ( ( unsigned short ) 70 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */\r
 #define configTOTAL_HEAP_SIZE                                  ( ( size_t ) ( 52 * 1024 ) )\r
 #define configMAX_TASK_NAME_LEN                                        ( 12 )\r
index 4cd9daa936ee784dd2a13fe7dd02df64e3018d9e..652a8071ec036fbe9d7f08fc4279cd8d4f06d55a 100644 (file)
@@ -34,6 +34,9 @@
 #include "task.h"\r
 #include "portmacro.h"\r
 \r
+/* Standard includes. */\r
+#include "string.h"\r
+\r
 #ifndef configCLINT_BASE_ADDRESS\r
        #warning configCLINT_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a Core Local Interrupter (CLINT) then set configCLINT_BASE_ADDRESS to the CLINT base address.  Otherwise set configCLINT_BASE_ADDRESS to 0.\r
 #endif\r
@@ -57,6 +60,11 @@ interrupt stack after the scheduler has started. */
 #ifdef configISR_STACK_SIZE_WORDS\r
        static __attribute__ ((aligned(16))) StackType_t xISRStack[ configISR_STACK_SIZE_WORDS ] = { 0 };\r
        const StackType_t xISRStackTop = ( StackType_t ) &( xISRStack[ configISR_STACK_SIZE_WORDS & ~portBYTE_ALIGNMENT_MASK ] );\r
+\r
+       /* Don't use 0xa5 as the stack fill bytes as that is used by the kernerl for\r
+       the task stacks, and so will legitimately appear in many positions within\r
+       the ISR stack. */\r
+       #define portISR_STACK_FILL_BYTE 0xee    \r
 #else\r
        extern const uint32_t __freertos_irq_stack_top[];\r
        const StackType_t xISRStackTop = ( StackType_t ) __freertos_irq_stack_top;\r
@@ -82,12 +90,8 @@ volatile uint64_t * pullMachineTimerCompareRegister = 0;
 stack checking.  A problem in the ISR stack will trigger an assert, not call the\r
 stack overflow hook function (because the stack overflow hook is specific to a\r
 task stack, not the ISR stack). */\r
-#if( configCHECK_FOR_STACK_OVERFLOW > 2 )\r
+#if defined( configISR_STACK_SIZE_WORDS ) && ( configCHECK_FOR_STACK_OVERFLOW > 2 )\r
        #warning This path not tested, or even compiled yet.\r
-       /* Don't use 0xa5 as the stack fill bytes as that is used by the kernerl for\r
-       the task stacks, and so will legitimately appear in many positions within\r
-       the ISR stack. */\r
-       #define portISR_STACK_FILL_BYTE 0xee\r
 \r
        static const uint8_t ucExpectedStackBytes[] = {\r
                                                                        portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE,             \\r
@@ -152,6 +156,12 @@ extern void xPortStartFirstTask( void );
                stack that was being used by main() prior to the scheduler being\r
                started. */\r
                configASSERT( ( xISRStackTop & portBYTE_ALIGNMENT_MASK ) == 0 );\r
+\r
+               #ifdef configISR_STACK_SIZE_WORDS\r
+               {\r
+                       memset( ( void * ) xISRStack, portISR_STACK_FILL_BYTE, sizeof( xISRStack ) );\r
+               }\r
+               #endif   /* configISR_STACK_SIZE_WORDS */\r
        }\r
        #endif /* configASSERT_DEFINED */\r
 \r
index fc1236e4678119bd436acb989136568911fa74e8..a28942a09fa6775496236b9d8630cdd2c9aa72eb 100644 (file)
@@ -172,7 +172,7 @@ handle_asynchronous:
                        li t4, -1\r
                        lw t2, 0(t1)                            /* Load the low word of ullNextTime into t2. */\r
                        lw t3, 4(t1)                            /* Load the high word of ullNextTime into t3. */\r
-                       sw t4, 0(t0)                            /* Low word no smaller than old value. */\r
+                       sw t4, 0(t0)                            /* Low word no smaller than old value to start with - will be overwritten below. */\r
                        sw t3, 4(t0)                            /* Store high word of ullNextTime into compare register.  No smaller than new value. */\r
                        sw t2, 0(t0)                            /* Store low word of ullNextTime into compare register. */\r
                        lw t0, uxTimerIncrementsForOneTick      /* Load the value of ullTimerIncrementForOneTick into t0 (could this be optimized by storing in an array next to pullNextTime?). */\r
@@ -226,7 +226,7 @@ is_exception:
        csrr t0, mcause                                         /* For viewing in the debugger only. */\r
        csrr t1, mepc                                           /* For viewing in the debugger only */\r
        csrr t2, mstatus\r
-       j is_exception\r
+       j is_exception                                          /* No other exceptions handled yet. */\r
 \r
 as_yet_unhandled:\r
        csrr t0, mcause                                         /* For viewing in the debugger only. */\r
index dd32a8e50ef5b072d4742cb0dc302b3b975ca273..a5ec465538b65faa0ce4da61a14cff055d9398c4 100644 (file)
@@ -34,6 +34,9 @@
 #include "task.h"\r
 #include "portmacro.h"\r
 \r
+/* Standard includes. */\r
+#include "string.h"\r
+\r
 #ifndef configCLINT_BASE_ADDRESS\r
        #warning configCLINT_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  If the target chip includes a Core Local Interrupter (CLINT) then set configCLINT_BASE_ADDRESS to the CLINT base address.  Otherwise set configCLINT_BASE_ADDRESS to 0.\r
 #endif\r
@@ -57,6 +60,11 @@ interrupt stack after the scheduler has started. */
 #ifdef configISR_STACK_SIZE_WORDS\r
        static __attribute__ ((aligned(16))) StackType_t xISRStack[ configISR_STACK_SIZE_WORDS ] = { 0 };\r
        const StackType_t xISRStackTop = ( StackType_t ) &( xISRStack[ configISR_STACK_SIZE_WORDS & ~portBYTE_ALIGNMENT_MASK ] );\r
+\r
+       /* Don't use 0xa5 as the stack fill bytes as that is used by the kernerl for\r
+       the task stacks, and so will legitimately appear in many positions within\r
+       the ISR stack. */\r
+       #define portISR_STACK_FILL_BYTE 0xee\r
 #else\r
        extern const uint32_t __freertos_irq_stack_top[];\r
        const StackType_t xISRStackTop = ( StackType_t ) __freertos_irq_stack_top;\r
@@ -77,17 +85,12 @@ const uint64_t *pullNextTime = &ullNextTime;
 const size_t uxTimerIncrementsForOneTick = ( size_t ) ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ); /* Assumes increment won't go over 32-bits. */\r
 volatile uint64_t * const pullMachineTimerCompareRegisterBase = ( uint64_t * ) ( configCLINT_BASE_ADDRESS + 0x4000 );\r
 volatile uint64_t * pullMachineTimerCompareRegister = 0;\r
-\r
 /* Set configCHECK_FOR_STACK_OVERFLOW to 3 to add ISR stack checking to task\r
 stack checking.  A problem in the ISR stack will trigger an assert, not call the\r
 stack overflow hook function (because the stack overflow hook is specific to a\r
 task stack, not the ISR stack). */\r
-#if( configCHECK_FOR_STACK_OVERFLOW > 2 )\r
+#if defined( configISR_STACK_SIZE_WORDS ) && ( configCHECK_FOR_STACK_OVERFLOW > 2 )\r
        #warning This path not tested, or even compiled yet.\r
-       /* Don't use 0xa5 as the stack fill bytes as that is used by the kernerl for\r
-       the task stacks, and so will legitimately appear in many positions within\r
-       the ISR stack. */\r
-       #define portISR_STACK_FILL_BYTE 0xee\r
 \r
        static const uint8_t ucExpectedStackBytes[] = {\r
                                                                        portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE,             \\r
index c4082c7b3c49e6f07d8c47d5c5a576b9538602b0..bcd58a878eff3a8d219375deabc6c68c3a082914 100644 (file)
@@ -99,12 +99,12 @@ at the top of this file. */
        EXTERN pxCurrentTCB\r
        EXTERN ulPortTrapHandler\r
        EXTERN vTaskSwitchContext\r
+       EXTERN xTaskIncrementTick\r
        EXTERN Timer_IRQHandler\r
        EXTERN pullMachineTimerCompareRegister\r
        EXTERN pullNextTime\r
        EXTERN uxTimerIncrementsForOneTick /* size_t type so 32-bit on 32-bit core and 64-bits on 64-bit core. */\r
        EXTERN xISRStackTop\r
-       EXTERN xTaskIncrementTick\r
        EXTERN portasmHANDLE_INTERRUPT\r
 \r
 /*-----------------------------------------------------------*/\r
@@ -231,11 +231,13 @@ test_if_environment_call:
        j processed_source\r
 \r
 is_exception:\r
-       ebreak\r
-       j is_exception\r
+       csrr t0, CSR_MCAUSE                                     /* For viewing in the debugger only. */\r
+       csrr t1, CSR_MEPC                                       /* For viewing in the debugger only */\r
+       csrr t2, CSR_MSTATUS\r
+       j is_exception                                          /* No other exceptions handled yet. */\r
 \r
 as_yet_unhandled:\r
-       ebreak\r
+       csrr t0, mcause                                         /* For viewing in the debugger only. */\r
        j as_yet_unhandled\r
 \r
 processed_source:\r