common_code_v1
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
common_code_v1 [2016/08/26 12:51] – [Timer1] hakcenter | common_code_v1 [2016/08/26 12:52] (current) – [Timer1] hakcenter | ||
---|---|---|---|
Line 245: | Line 245: | ||
==== Timer1 ==== | ==== Timer1 ==== | ||
< | < | ||
- | /* | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | */ | ||
- | |||
void sweep() { | void sweep() { | ||
if (turbo_feedback > 110) { | if (turbo_feedback > 110) { | ||
Line 336: | Line 326: | ||
void keep_time() { | void keep_time() { | ||
timer++; | timer++; | ||
+ | // Startup Timer | ||
+ | if (turbo_rpm < minimum_turbo_rpm) { | ||
+ | if (startup > 249) { startup = 250; } | ||
+ | startup++; | ||
+ | } | ||
// Update vane_position every 10ms 100k+ / 25ms 60k - 100k / 100ms 0 - 60k | // Update vane_position every 10ms 100k+ / 25ms 60k - 100k / 100ms 0 - 60k | ||
if (timer % 10 == 0 && turbo_rpm > top_end_rpm) { update_vane_position = true; } | if (timer % 10 == 0 && turbo_rpm > top_end_rpm) { update_vane_position = true; } | ||
Line 350: | Line 345: | ||
if (turbo_rpm < top_end_rpm) { turbo_accel[2] = turbo_accel[1]; | if (turbo_rpm < top_end_rpm) { turbo_accel[2] = turbo_accel[1]; | ||
} | } | ||
+ | // Read Serial Input | ||
+ | if (timer % 10 == 0 && check_serial()) { read_serial(); | ||
+ | // Read CAN BUS | ||
+ | if (timer % 25 == 0) { read_can_data(can_id, | ||
// Modes | // Modes | ||
if (timer % 100 == 0 && turbo_rpm < top_end_rpm) { calculate_modes(); | if (timer % 100 == 0 && turbo_rpm < top_end_rpm) { calculate_modes(); | ||
+ | // Sweep vane_position | ||
+ | if (timer % 25 == 0 && sweep_position) { sweep(); } | ||
// Calculate vane_position | // Calculate vane_position | ||
- | if (update_vane_position) { | + | if (update_vane_position |
update_vane_position = false; | update_vane_position = false; | ||
calculate_vane_position(); | calculate_vane_position(); |
common_code_v1.txt · Last modified: 2016/08/26 12:52 by hakcenter