Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
b46cfb9c
Commit
b46cfb9c
authored
Jun 27, 2014
by
Theodor-Adrian Stana
Committed by
Matthieu Cattin
Sep 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: Checked out Orson's RTX and common folders
parent
047b701a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
RTX_ex2.c
sw/RTX/Examples/RTX_ex2/RTX_ex2.c
+16
-9
Makefile
sw/freertos_blink/armgcc/Makefile
+3
-0
No files found.
sw/RTX/Examples/RTX_ex2/RTX_ex2.c
View file @
b46cfb9c
...
...
@@ -46,16 +46,21 @@ volatile uint16_t counter3; /* counter for thread 3 */
osThreadId
thread1_id
;
osThreadId
thread2_id
;
osThreadId
thread3_id
;
osThreadId
thread4_id
;
/* Forward reference */
void
job1
(
void
const
*
argument
);
void
job2
(
void
const
*
argument
);
void
job3
(
void
const
*
argument
);
void
job4
(
void
const
*
argument
);
#define STKSIZE 150
/* Thread definitions */
osThreadDef
(
job1
,
osPriorityAboveNormal
,
1
,
0
);
osThreadDef
(
job2
,
osPriorityNormal
,
1
,
0
);
osThreadDef
(
job3
,
osPriorityNormal
,
1
,
0
);
osThreadDef
(
job1
,
osPriorityAboveNormal
,
1
,
STKSIZE
);
osThreadDef
(
job2
,
osPriorityNormal
,
1
,
STKSIZE
);
osThreadDef
(
job3
,
osPriorityNormal
,
1
,
STKSIZE
);
osThreadDef
(
job4
,
osPriorityNormal
,
1
,
STKSIZE
);
/*----------------------------------------------------------------------------
* Thread 1: 'job1'
...
...
@@ -87,6 +92,13 @@ void job3 (void const *argument) {
}
}
void
job4
(
void
const
*
argument
)
{
while
(
1
)
{
/* endless loop */
osDelay
(
62
);
/* wait for timeout: 50m */
GPIO_PinOutToggle
(
gpioPortD
,
4
);
}
}
/*----------------------------------------------------------------------------
* Main Thread
*---------------------------------------------------------------------------*/
...
...
@@ -106,12 +118,7 @@ int main (void) { /* program execution starts here */
thread1_id
=
osThreadCreate
(
osThread
(
job1
),
NULL
);
/* create thread1 */
thread2_id
=
osThreadCreate
(
osThread
(
job2
),
NULL
);
/* create thread2 */
thread3_id
=
osThreadCreate
(
osThread
(
job3
),
NULL
);
/* create thread3 */
while
(
1
)
{
/* endless loop */
counter
++
;
/* increment counter */
osDelay
(
62
);
/* wait for timeout: 50m */
GPIO_PinOutToggle
(
gpioPortD
,
4
);
}
thread4_id
=
osThreadCreate
(
osThread
(
job4
),
NULL
);
/* create thread3 */
}
/*----------------------------------------------------------------------------
...
...
sw/freertos_blink/armgcc/Makefile
View file @
b46cfb9c
...
...
@@ -79,6 +79,7 @@ LD = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-ld$(QUOTE)
AR
=
$(QUOTE)$(TOOLDIR)
/bin/arm-none-eabi-ar
$(QUOTE)
OBJCOPY
=
$(QUOTE)$(TOOLDIR)
/bin/arm-none-eabi-objcopy
$(QUOTE)
DUMP
=
$(QUOTE)$(TOOLDIR)
/bin/arm-none-eabi-objdump
$(QUOTE)
SIZE
=
$(QUOTE)$(TOOLDIR)
/bin/arm-none-eabi-size
$(QUOTE)
####################################################################
# Flags #
...
...
@@ -205,6 +206,8 @@ $(EXE_DIR)/$(PROJECTNAME).bin: $(EXE_DIR)/$(PROJECTNAME).out
$(OBJCOPY)
-O
binary
$(EXE_DIR)
/
$(PROJECTNAME)
.out
$(EXE_DIR)
/
$(PROJECTNAME)
.bin
# Uncomment next line to produce assembly listing of entire program
# $(DUMP) -h -S -C $(EXE_DIR)/$(PROJECTNAME).out>$(LST_DIR)/$(PROJECTNAME)out.lst
# Uncomment next line to produce code footprint
$(SIZE)
$<
clean
:
ifeq
($(filter
$(MAKECMDGOALS),all
debug
release),)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment