Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
RCU2HBAT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
RCU2HBAT
Commits
c64690b5
Commit
c64690b5
authored
Feb 28, 2022
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
Frontpant LEDs fixed
parent
84ad1032
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.c
+6
-1
6 additions, 1 deletion
main.c
mainloop.c
+7
-1
7 additions, 1 deletion
mainloop.c
src/version.h
+1
-1
1 addition, 1 deletion
src/version.h
with
14 additions
and
3 deletions
main.c
+
6
−
1
View file @
c64690b5
...
...
@@ -81,6 +81,9 @@ void GoToSleep(){
// IC3CON1 = 0x02;
LED_on
();
}
#define HBA1_LED _LATA3
#define HBA2_LED _LATB4
#define HBA3_LED _LATA4
#define HBA_(name) HBA1_ ## name
#define SPI_(name) SPI1 ## name
...
...
@@ -132,7 +135,9 @@ int main(void)
_LATB10
=
1
;
_LATB15
=
1
;
//SPI pins high = 0V output
//SPI1BUFL=~0x00;
HBA1_LED
=
1
;
//LED off
HBA2_LED
=
1
;
//LED off
HBA3_LED
=
1
;
//LED off
HBA1_state
=
HBA_STATE_IDLE
;
while
(
1
)
{
...
...
This diff is collapsed.
Click to expand it.
mainloop.c
+
7
−
1
View file @
c64690b5
...
...
@@ -7,6 +7,7 @@ inline void HBA_(Handle_IC_Capture)()
else
{
HBA_
(
IC_previous
)
=
TMR3
;
HBA_
(
state
)
=
HBA_STATE_RX
;
HBA_
(
LED
)
=
0
;
//LED on
HBA_
(
decode_start
)();
}
}
...
...
@@ -14,7 +15,10 @@ inline void HBA_(mainloop)()
{
switch
(
HBA_
(
state
))
{
case
HBA_STATE_IDLE
:
if
(
HBA_
(
TX_waiting
)())
HBA_
(
state
)
=
HBA_STATE_TX
;
if
(
HBA_
(
TX_waiting
)())
{
HBA_
(
state
)
=
HBA_STATE_TX
;
HBA_
(
LED
)
=
0
;
//LED on
}
break
;
case
HBA_STATE_TX
:
if
(
SPI_
(
STATLbits
).
SPITBF
)
break
;
//Do nothing until finished transmitting character
...
...
@@ -44,6 +48,7 @@ inline void HBA_(mainloop)()
if
(
HBA_RX_Mode
()
==
2
)
if
(
HBA_
(
I2CReg_waiting
)())
HBA_
(
start_TX
)();
//IC1_Stop();
HBA_
(
state
)
=
HBA_STATE_IDLE
;
HBA_
(
LED
)
=
1
;
//LED off
}
break
;
case
HBA_STATE_RX
:
//Process edges until we have a time-out
...
...
@@ -58,6 +63,7 @@ inline void HBA_(mainloop)()
HBA_
(
RX_finished
)();
if
(
HBA_RX_Mode
()
==
2
)
{
HBA_
(
I2CReg_decode_responce
)();
if
(
HBA_
(
I2CReg_waiting
)())
HBA_
(
start_TX
)();}
HBA_
(
state
)
=
HBA_STATE_IDLE
;
HBA_
(
LED
)
=
1
;
//LED off
//IC1_Stop();
}
break
;
...
...
This diff is collapsed.
Click to expand it.
src/version.h
+
1
−
1
View file @
c64690b5
//This is the git commit SHA and is updated after the commit...
#ifndef SOFTWARE_VERSION
#define SOFTWARE_VERSION 0x
5bef0727
#define SOFTWARE_VERSION 0x
84ad1032
#endif
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