Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wicj_embeddedlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julia Scharsich
wicj_embeddedlab
Commits
6989e776
Commit
6989e776
authored
5 years ago
by
Julia Scharsich
Browse files
Options
Downloads
Patches
Plain Diff
Update lay1+2_remastered.c
parent
473a10ea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interrupts/crc/lay1+2_remastered.c
+8
-8
8 additions, 8 deletions
interrupts/crc/lay1+2_remastered.c
with
8 additions
and
8 deletions
interrupts/crc/lay1+2_remastered.c
+
8
−
8
View file @
6989e776
...
...
@@ -26,8 +26,8 @@ byte frame[MAXFRAMESIZE] = {0}; // 0 - Preambel, 1 to 4 - CRC checksum, 5 - size
byte
**
queue
;
byte
flag
=
1
;
uint16_t
bufferIndex
=
0
;
// Zählvariable für ISR
uint16_t
sendIndex
=
0
;
byte
bufferIndex
=
0
;
// Zählvariable für ISR
byte
sendIndex
=
0
;
byte
bitIndex
=
7
;
byte
readyToReceive
=
0
;
byte
readyToSend
=
0
;
...
...
@@ -36,8 +36,8 @@ byte readyToSend = 0;
void
delay
(
int
ms
){
while
(
ms
>
0
){
_delay_ms
(
1
);
ms
--
;
_delay_ms
(
1
);
ms
--
;
}
return
;
}
...
...
@@ -55,7 +55,7 @@ void fillSend (byte* payload, byte size){
send
[
5
]
=
size
;
for
(
byte
i
=
6
;
i
<
size
+
6
;
i
++
){
//+
6
für preamble, crc, size
,
for
(
byte
i
=
6
;
i
<
size
+
6
;
i
++
){
//+
8
für preamble, crc, size
; dest, src gehören zur payload
send
[
i
]
=
payload
[
i
-
6
];
}
readyToSend
=
1
;
...
...
@@ -82,9 +82,9 @@ int main(void){
setup_PinC
();
sei
();
//set SREG (one)
uint16_t
receiveIndex
=
0
;
byte
receiveIndex
=
0
;
byte
*
receivedFrame
=
malloc
(
MAXFRAMESIZE
*
sizeof
(
byte
));
uint16_t
sizeToReceive
=
MAXFRAMESIZE
;
byte
sizeToReceive
=
MAXFRAMESIZE
;
byte
action
;
// 0 - broadcast successful, to layer 4; 1 - receive, to layer 4; 2 - relay
/*
...
...
@@ -178,7 +178,7 @@ int main(void){
PORTB
&=
~
(
1
<<
PB3
);
//PB3 löschen -> LED aus
}
if
(
bitIndex
==
0
)
sendIndex
++
;
if
(
sendIndex
==
(
uint16_t
)
send
[
5
]
+
6
)
{
if
(
sendIndex
==
send
[
5
]
+
6
)
{
sendIndex
=
0
;
readyToSend
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment