Commit f6436be7 by trkall

updated LAB3

parent 2839c6f8
......@@ -100,7 +100,10 @@
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<nTsel>3</nTsel>
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>-1</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
......@@ -172,6 +175,17 @@
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<pMisraNamep></pMisraNamep>
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
</TargetOption>
</Target>
......@@ -186,7 +200,6 @@
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\inc\BSP.c</PathWithFileName>
......@@ -199,7 +212,6 @@
<FileNumber>2</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Lab3.c</PathWithFileName>
......@@ -212,7 +224,6 @@
<FileNumber>3</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\osasm.s</PathWithFileName>
......@@ -225,7 +236,6 @@
<FileNumber>4</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\os.c</PathWithFileName>
......@@ -238,7 +248,6 @@
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\inc\Profile.c</PathWithFileName>
......@@ -259,7 +268,6 @@
<FileNumber>6</FileNumber>
<FileType>3</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\texas.o</PathWithFileName>
......
......@@ -10,11 +10,13 @@
<TargetName>Target</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>TM4C123GH6PM</Device>
<Vendor>Texas Instruments</Vendor>
<PackID>Keil.TM4C_DFP.1.0.0</PackID>
<PackID>Keil.TM4C_DFP.1.1.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IROM(0x00000000,0x040000) IRAM(0x20000000,0x008000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
......@@ -84,6 +86,8 @@
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X>
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
......@@ -122,47 +126,6 @@
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
<Simulator>
<UseSimulator>0</UseSimulator>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>1</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>1</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
<RestoreSysVw>1</RestoreSysVw>
</Simulator>
<Target>
<UseTarget>1</UseTarget>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>1</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>0</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreSysVw>1</RestoreSysVw>
</Target>
<RunDebugAfterBuild>0</RunDebugAfterBuild>
<TargetSelection>3</TargetSelection>
<SimDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
</SimDlls>
<TargetDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
<Driver>BIN\lmidk-agdi.dll</Driver>
</TargetDlls>
</DebugOption>
<Utilities>
<Flash1>
......@@ -170,7 +133,7 @@
<UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
<Capability>0</Capability>
<DriverSelection>4096</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
......@@ -221,12 +184,14 @@
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>1</RvdsVP>
<RvdsMve>0</RvdsMve>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>0</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
<RoSelD>3</RoSelD>
<RwSelD>3</RwSelD>
<CodeSel>0</CodeSel>
......@@ -360,7 +325,15 @@
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>1</v6Lang>
<v6LangP>1</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
......@@ -378,6 +351,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
ARM Macro Assembler Page 1
1 00000000 ;/******************************************************
***********************/
2 00000000 ; OSasm.s: low-level OS commands, written in assembly
*/
3 00000000 ; Runs on LM4F120/TM4C123/MSP432
4 00000000 ; Lab 3 starter file
5 00000000 ; March 2, 2016
6 00000000
7 00000000
8 00000000
9 00000000
10 00000000 AREA |.text|, CODE, READONLY, ALIGN=
2
11 00000000 THUMB
12 00000000 REQUIRE8
13 00000000 PRESERVE8
14 00000000
15 00000000 EXTERN RunPt ; currently running
thread
16 00000000 EXPORT StartOS
17 00000000 EXPORT SysTick_Handler
18 00000000 IMPORT Scheduler
19 00000000
20 00000000
21 00000000 SysTick_Handler ; 1) Saves R0-R3,R1
2,LR,PC,PSR
22 00000000 B672 CPSID I ; 2) Prevent interr
upt during switch
23 00000002 E92D 0FF0 PUSH {R4-R11} ; 3) Save remaining
regs r4-11
24 00000006 480F LDR R0, =RunPt ; 4) R0=pointer to
RunPt, old thread
25 00000008 6801 LDR R1, [R0] ; R1 = RunPt
26 0000000A F8C1 D000 STR SP, [R1] ; 5) Save SP into T
CB
27 0000000E B501 PUSH {R0,LR}
28 00000010 F7FF FFFE BL Scheduler
29 00000014 E8BD 4001 POP {R0,LR}
30 00000018 6801 LDR R1, [R0] ; 6) R1 = RunPt, ne
w thread
31 0000001A F8D1 D000 LDR SP, [R1] ; 7) new thread SP;
SP = RunPt->sp;
32 0000001E E8BD 0FF0 POP {R4-R11} ; 8) restore regs r
4-11
33 00000022 B662 CPSIE I ; 9) tasks run with
interrupts enabled
34 00000024 4770 BX LR ; 10) restore R0-R3
,R12,LR,PC,PSR
35 00000026 StartOS
36 00000026 4807 LDR R0, =RunPt ; Load addr of RunP
t into R0
37 00000028 6801 LDR R1, [R0] ; Load value of Run
Pt into R1
38 0000002A F8D1 D000 LDR SP, [R1] ; Load thread's SP
from TCB into CPU S
P
39 0000002E E8BD 0FF0 POP {R4-R11} ; Pop R4 - R11 from
new SP (SP now poi
ARM Macro Assembler Page 2
nts to R0 location)
40 00000032 BC0F POP {R0-R3} ; Pop R0 - R3 from
SP (SP now points t
o R12 location)
41 00000034 F85D CB04 POP {R12} ; Pop R12 (SP now p
oints to LR (R14))
42 00000038 B001 ADD SP, SP, #4 ; Skip LR by increm
enting SP (SP now p
oints to PC)
43 0000003A ; - LR is invalid since this is the initial run
44 0000003A F85D EB04 POP {LR} ; Pop PC (R15) into
LR (SP now points
to PSR)
45 0000003E ; - PC should have already been initialized to start of
tasks function
46 0000003E ; - Popping directly into LR means that task will run w
hen we BX LR
47 0000003E B001 ADD SP, SP, #4 ; Skip PSR by incr.
SP (SP now points
to bottom of tasks
stack)
48 00000040 B662 CPSIE I ; Enable interrupts
at processor level
49 00000042 4770 BX LR ; start first threa
d
50 00000044
51 00000044 ALIGN
52 00000044 END
00000000
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M4 --apcs=interw
ork --depend=.\objects\osasm.d -o.\objects\osasm.o -I.\RTE\_Target -IC:\Users\T
ref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\
AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 --predefine=
"__EVAL SETA 1" --predefine="__UVISION_VERSION SETA 529" --predefine="_RTE_ SET
A 1" --predefine="TM4C123GH6PM SETA 1" --list=.\listings\osasm.lst osasm.s
ARM Macro Assembler Page 1 Alphabetic symbol ordering
Relocatable symbols
.text 00000000
Symbol: .text
Definitions
At line 10 in file osasm.s
Uses
None
Comment: .text unused
StartOS 00000026
Symbol: StartOS
Definitions
At line 35 in file osasm.s
Uses
At line 16 in file osasm.s
Comment: StartOS used once
SysTick_Handler 00000000
Symbol: SysTick_Handler
Definitions
At line 21 in file osasm.s
Uses
At line 17 in file osasm.s
Comment: SysTick_Handler used once
3 symbols
ARM Macro Assembler Page 1 Alphabetic symbol ordering
External symbols
RunPt 00000000
Symbol: RunPt
Definitions
At line 15 in file osasm.s
Uses
At line 24 in file osasm.s
At line 36 in file osasm.s
Scheduler 00000000
Symbol: Scheduler
Definitions
At line 18 in file osasm.s
Uses
At line 28 in file osasm.s
Comment: Scheduler used once
2 symbols
341 symbols in table
This source diff could not be displayed because it is too large. You can view the blob instead.
<html>
<body>
<pre>
<h1>Vision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: Vision V5.29.0.0
Copyright (C) 2019 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: Trevor Kallaste, Tref O, LIC=----
Tool Versions:
Toolchain: MDK-Lite Version: 5.29.0.0
Toolchain Path: C:\Keil_v5\ARM\ARMCC\Bin
C Compiler: Armcc.exe V5.06 update 6 (build 750)
Assembler: Armasm.exe V5.06 update 6 (build 750)
Linker/Locator: ArmLink.exe V5.06 update 6 (build 750)
Library Manager: ArmAr.exe V5.06 update 6 (build 750)
Hex Converter: FromElf.exe V5.06 update 6 (build 750)
CPU DLL: SARMCM3.DLL V5.29.0.0
Dialog DLL: DCM.DLL V1.17.3.0
Target DLL: lmidk-agdi.dll
Dialog DLL: TCM.DLL V1.36.5.0
<h2>Project:</h2>
C:\Users\Tref\bes_labs_2020\Labware\Lab3_4C123\Lab3.uvprojx
Project File Date: 04/26/2020
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Target'
assembling osasm.s...
compiling os.c...
compiling Lab3.c...
assembling startup_TM4C123.s...
compiling system_TM4C123.c...
compiling Profile.c...
compiling BSP.c...
linking...
Program Size: Code=18920 RO-data=2128 RW-data=400 ZI-data=6952
".\Objects\Lab3.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.6.0.pack
ARM.CMSIS.5.6.0
CMSIS (Cortex Microcontroller Software Interface Standard)
* Component: CORE Version: 5.3.0
Package Vendor: Keil
http://www.keil.com/pack/Keil.TM4C_DFP.1.1.0.pack
Keil.TM4C_DFP.1.1.0
Texas Instruments Tiva C Series Device Support and Examples
* Component: Startup Version: 1.0.1
<h2>Collection of Component include folders:</h2>
.\RTE\_Target
C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include
C:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.3.0
* Component: Keil::Device:Startup:1.0.1
Include file: Device\Include\TM4C123\TM4C123.h
Source file: Device\Source\ARM\startup_TM4C123.s
Source file: Device\Source\system_TM4C123.c
Build Time Elapsed: 00:00:01
</pre>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
--cpu=Cortex-M4 --fpu=SoftVFP
".\objects\bsp.o"
".\objects\lab3.o"
".\objects\osasm.o"
".\objects\os.o"
".\objects\profile.o"
".\texas.o"
".\objects\startup_tm4c123.o"
".\objects\system_tm4c123.o"
--ro-base 0x00000000 --entry 0x00000000 --rw-base 0x20000000 --entry Reset_Handler --first __Vectors --strict --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers
--list ".\Listings\Lab3.map" -o .\Objects\Lab3.axf
\ No newline at end of file
Dependencies for Project 'Lab3', Target 'Target': (DO NOT MODIFY !)
CompilerVersion: 5060750::V5.06 update 6 (build 750)::ARMCC
F (..\inc\BSP.c)(0x5C97D55C)(--c99 -c --cpu Cortex-M4 -D__EVAL -g -O0 --apcs=interwork --split_sections --signed_chars -I ../inc -I.\RTE\_Target -IC:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 -D__UVISION_VERSION="529" -D_RTE_ -DTM4C123GH6PM -o .\objects\bsp.o --omf_browse .\objects\bsp.crf --depend .\objects\bsp.d)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5D9B2678)
I (..\inc\BSP.h)(0x57B9E054)
I (..\inc\../inc/tm4c123gh6pm.h)(0x5C62BC12)
F (.\Lab3.c)(0x5C97D264)(--c99 -c --cpu Cortex-M4 -D__EVAL -g -O0 --apcs=interwork --split_sections --signed_chars -I ../inc -I.\RTE\_Target -IC:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 -D__UVISION_VERSION="529" -D_RTE_ -DTM4C123GH6PM -o .\objects\lab3.o --omf_browse .\objects\lab3.crf --depend .\objects\lab3.d)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5D9B2678)
I (../inc/BSP.h)(0x57B9E054)
I (../inc/CortexM.h)(0x56B6D6E6)
I (os.h)(0x57BDFBA0)
I (../inc/Profile.h)(0x575817E4)
I (Texas.h)(0x56F2E934)
F (.\osasm.s)(0x5EA541C0)(--cpu Cortex-M4 --pd "__EVAL SETA 1" -g --apcs=interwork -I.\RTE\_Target -IC:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 --pd "__UVISION_VERSION SETA 529" --pd "_RTE_ SETA 1" --pd "TM4C123GH6PM SETA 1" --list .\listings\osasm.lst --xref -o .\objects\osasm.o --depend .\objects\osasm.d)
F (.\os.c)(0x5EA57D1C)(--c99 -c --cpu Cortex-M4 -D__EVAL -g -O0 --apcs=interwork --split_sections --signed_chars -I ../inc -I.\RTE\_Target -IC:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 -D__UVISION_VERSION="529" -D_RTE_ -DTM4C123GH6PM -o .\objects\os.o --omf_browse .\objects\os.crf --depend .\objects\os.d)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5D9B2678)
I (os.h)(0x57BDFBA0)
I (../inc/CortexM.h)(0x56B6D6E6)
I (../inc/BSP.h)(0x57B9E054)
F (..\inc\Profile.c)(0x57581976)(--c99 -c --cpu Cortex-M4 -D__EVAL -g -O0 --apcs=interwork --split_sections --signed_chars -I ../inc -I.\RTE\_Target -IC:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 -D__UVISION_VERSION="529" -D_RTE_ -DTM4C123GH6PM -o .\objects\profile.o --omf_browse .\objects\profile.crf --depend .\objects\profile.d)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5D9B2678)
I (..\inc\../inc/tm4c123gh6pm.h)(0x5C62BC12)
F (.\texas.o)(0x57BDF3F8)()
F (RTE\Device\TM4C123GH6PM\startup_TM4C123.s)(0x56BB73FC)(--cpu Cortex-M4 --pd "__EVAL SETA 1" -g --apcs=interwork -I.\RTE\_Target -IC:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 --pd "__UVISION_VERSION SETA 529" --pd "_RTE_ SETA 1" --pd "TM4C123GH6PM SETA 1" --list .\listings\startup_tm4c123.lst --xref -o .\objects\startup_tm4c123.o --depend .\objects\startup_tm4c123.d)
F (RTE\Device\TM4C123GH6PM\system_TM4C123.c)(0x52539E14)(--c99 -c --cpu Cortex-M4 -D__EVAL -g -O0 --apcs=interwork --split_sections --signed_chars -I ../inc -I.\RTE\_Target -IC:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IC:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123 -D__UVISION_VERSION="529" -D_RTE_ -DTM4C123GH6PM -o .\objects\system_tm4c123.o --omf_browse .\objects\system_tm4c123.crf --depend .\objects\system_tm4c123.d)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5D9B2678)
I (C:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123\TM4C123.h)(0x530EE4E6)
I (C:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123\TM4C123GH6PM.h)(0x550FD41C)
I (C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\core_cm4.h)(0x5D25E516)
I (C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\cmsis_version.h)(0x5D25E516)
I (C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\cmsis_compiler.h)(0x5D25E516)
I (C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\cmsis_armcc.h)(0x5D25E516)
I (C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\mpu_armv7.h)(0x5C8FA234)
I (C:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123\system_TM4C123.h)(0x51B6D5F6)
.\objects\bsp.o: ..\inc\BSP.c
.\objects\bsp.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\bsp.o: ..\inc\BSP.h
.\objects\bsp.o: ..\inc\../inc/tm4c123gh6pm.h
.\objects\lab3.o: Lab3.c
.\objects\lab3.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\lab3.o: ../inc/BSP.h
.\objects\lab3.o: ../inc/CortexM.h
.\objects\lab3.o: os.h
.\objects\lab3.o: ../inc/Profile.h
.\objects\lab3.o: Texas.h
.\objects\os.o: os.c
.\objects\os.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\os.o: os.h
.\objects\os.o: ../inc/CortexM.h
.\objects\os.o: ../inc/BSP.h
.\objects\osasm.o: osasm.s
.\objects\profile.o: ..\inc\Profile.c
.\objects\profile.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\profile.o: ..\inc\../inc/tm4c123gh6pm.h
.\objects\startup_tm4c123.o: RTE\Device\TM4C123GH6PM\startup_TM4C123.s
.\objects\system_tm4c123.o: RTE\Device\TM4C123GH6PM\system_TM4C123.c
.\objects\system_tm4c123.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123\TM4C123.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123\TM4C123GH6PM.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\core_cm4.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\cmsis_version.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\cmsis_compiler.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\cmsis_armcc.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include\mpu_armv7.h
.\objects\system_tm4c123.o: C:\Users\Tref\AppData\Local\Arm\Packs\Keil\TM4C_DFP\1.1.0\Device\Include\TM4C123\system_TM4C123.h
......@@ -26,10 +26,10 @@ struct tcb{
// nonzero if this thread is sleeping
//*FILL THIS IN****
};
struct ptcb{
uint32_t period;
uint32_t counter;
void (*thread)();
struct ptcb{//for periodic events
uint32_t period;// rate
uint64_t counter;
void (*thread)();//thread pointer
};
typedef struct ptcb ptcbType;
......@@ -38,8 +38,6 @@ typedef struct tcb tcbType;
tcbType tcbs[NUMTHREADS];
tcbType *RunPt;
int32_t Stacks[NUMTHREADS][STACKSIZE];
void (*periodicTask)(void) = 0;
uint32_t periodicRate = 0;//rate for a task
int events = 0;
// ******** OS_Init ************
......@@ -138,11 +136,11 @@ int OS_AddThreads(void(*thread0)(void),
// In Lab 3 this will be called exactly twice
int OS_AddPeriodicEventThread(void(*thread)(void), uint32_t period){
// ****IMPLEMENT THIS****
periodicEvents[events].thread = thread;
periodicEvents[events].period = period;
periodicEvents[events].counter = period;
periodicEvents[events].thread = thread;//assign pointer
periodicEvents[events].period = period;//assing rate
periodicEvents[events].counter = 0;//counter initialy 0
events++;
periodicRate = period;
return 1;
}
......@@ -154,18 +152,17 @@ void static runperiodicevents(void){
uint32_t i;
for(i = 0; i < events; i++)
{
periodicEvents[i].counter--;
if(periodicEvents[i].counter % periodicEvents[i].period == 0)
periodicEvents[i].counter++;//increase counter by 1
if(periodicEvents[i].counter % periodicEvents[i].period == 0)//run
{
periodicEvents[i].thread();
periodicEvents[i].counter = periodicEvents[i].period;
}
}
for (i = 0; i < NUMTHREADS; i ++){
for (i = 0; i < NUMTHREADS; i ++){//check sleeping threads
if (tcbs[i].sleeping > 0)
{
(tcbs[i].sleeping) = (tcbs[i].sleeping) - 1;
(tcbs[i].sleeping) = (tcbs[i].sleeping) - 1;//reduce sleeptime by 1
}
}
EnableInterrupts();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment