Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CJ2 to CJ3
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
Model registry
Analyze
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
Automotive
GMT800
CJ2 to CJ3
Commits
21c6d08d
Commit
21c6d08d
authored
2 years ago
by
David G. Martin IV
Browse files
Options
Downloads
Plain Diff
Merge branch '11-fan-speed-wrong-on-startup' into 'master'
Change fan speed handling Closes
#11
See merge request
!7
parents
8b3e9cd5
22e10fe9
Branches
Branches containing commit
Tags
firmware-v1.1
Tags containing commit
1 merge request
!7
Change fan speed handling
Pipeline
#489
passed
2 years ago
Stage: build
Changes
4
Pipelines
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
firmware/build.sh
+2
-2
2 additions, 2 deletions
firmware/build.sh
firmware/debug/debug.ino
+0
-0
0 additions, 0 deletions
firmware/debug/debug.ino
firmware/main/main.ino
+6
-17
6 additions, 17 deletions
firmware/main/main.ino
firmware/platformio.ini
+1
-0
1 addition, 0 deletions
firmware/platformio.ini
with
9 additions
and
19 deletions
firmware/build.sh
+
2
−
2
View file @
21c6d08d
...
...
@@ -7,10 +7,10 @@ if [[ -z ${COMMIT_REF} ]]; then
fi
for
firmware
in
*
;
do
if
[[
-d
${
firmware
}
&&
-
d
${
firmware
}
/
src
]]
;
then
if
[[
-d
${
firmware
}
&&
-
f
${
firmware
}
/
${
firmware
}
.ino
]]
;
then
cp
platformio.ini
"
${
firmware
}
/"
cd
"
${
firmware
}
"
sed
-i
's/__GIT_DESCRIBE__/'
"
${
COMMIT_REF
}
"
'/'
src/
*
.ino
sed
-i
's/__GIT_DESCRIBE__/'
"
${
COMMIT_REF
}
"
'/'
${
firmware
}
.ino
platformio run
mv
.pio/build/teensylc/firmware.hex
"../
${
firmware
}
-
${
COMMIT_REF
}
.hex"
cd
..
...
...
This diff is collapsed.
Click to expand it.
firmware/debug/
src/
debug.ino
→
firmware/debug/debug.ino
+
0
−
0
View file @
21c6d08d
File moved
This diff is collapsed.
Click to expand it.
firmware/main/
src/
main.ino
→
firmware/main/main.ino
+
6
−
17
View file @
21c6d08d
...
...
@@ -108,11 +108,9 @@ void PrintUsage();
const
double
Get_IGN3_V
(
const
bool
print
=
false
);
// Read fan speed selection (0 to 5, <0 on error)
int
Get_Fan_Speed
();
int
Get_Fan_Speed
(
const
double
IGN3_V
);
// Set blower PWM automatically (calls Get_Fan_Speed) or by fan speed (0-5)
void
Set_Fan_Speed
();
// Set blower PWM by fan speed (0-5)
void
Set_Fan_Speed
(
const
int
fan_speed
);
// Set blower PWM value
...
...
@@ -142,7 +140,7 @@ SnoozeUSBSerial usb;
SnoozeBlock
snoozeConfig
(
snoozeCompare
,
snoozelc5vBuffer
,
usb
);
// Current fan speed
int
current_fan_speed
=
-
1
;
volatile
int
current_fan_speed
=
-
1
0
;
// -----------------------------------------------------------------------------
// Function Definitions
...
...
@@ -179,6 +177,7 @@ void setup()
analogWriteFrequency
(
pin_Blower_PWM
,
PWM_freq
);
analogWriteResolution
(
PWM_bits
);
analogWrite
(
pin_Blower_PWM
,
0
);
// Off at startup
current_fan_speed
=
-
11
;
// Wake when IGN3 is above IGN3_min_V
snoozeCompare
.
pinMode
(
pin_IGN3_wake
,
HIGH
,
IGN3_min_V
/
IGN3_VD_Ratio
);
...
...
@@ -319,11 +318,6 @@ const double Get_IGN3_V(const bool print)
return
IGN3_V
;
}
int
Get_Fan_Speed
()
{
return
Get_Fan_Speed
(
Get_IGN3_V
());
}
int
Get_Fan_Speed
(
const
double
IGN3_V
)
{
// Disable fan with low IGN3 voltage
...
...
@@ -349,15 +343,10 @@ int Get_Fan_Speed(const double IGN3_V)
else
{
return
5
;
}
}
void
Set_Fan_Speed
()
{
Set_Fan_Speed
(
Get_Fan_Speed
());
}
void
Set_Fan_Speed
(
const
int
fan_speed
)
{
current_fan_speed
=
fan_speed
;
SetPWM
(
FanToPWM
(
fan_speed
));
current_fan_speed
=
fan_speed
;
}
void
SetPWM
(
const
int
blower_PWM
)
...
...
@@ -395,7 +384,7 @@ const int FanToPWM(const int fan_speed)
void
Hibernate
()
{
// Prepare for hibernation
Set_Fan_Speed
(
0
);
// disable blower
Set_Fan_Speed
(
-
10
0
);
// disable blower
digitalWrite
(
pin_NTC_en
,
LOW
);
// disable NTCs
if
(
usb
)
{
...
...
@@ -406,7 +395,7 @@ void Hibernate()
}
// Hibernate
const
int
who
=
Snooze
.
hibernate
(
snoozeConfig
);
Snooze
.
hibernate
(
snoozeConfig
);
}
void
PrintEverything
()
...
...
This diff is collapsed.
Click to expand it.
firmware/platformio.ini
+
1
−
0
View file @
21c6d08d
[platformio]
default_envs
=
teensylc
src_dir
=
.
[env:teensylc]
platform
=
teensy
...
...
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