Rev 6 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 6 | Rev 7 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | 2 | ||
| 3 | #pragma once |
3 | #pragma once |
| 4 | #include "stdint.h" |
4 | #include "stdint.h" |
| 5 | 5 | ||
| 6 | static const int TIMING_SCALE = 10; |
6 | static const int TIMING_SCALE = 10; |
| - | 7 | // number of RPM lookup values |
|
| 7 | static unsigned const MAX_TIMING_POINTS = 8; |
8 | static unsigned const MAX_RPM_POINTS = 8; |
| - | 9 | // number of vacuum lookup points |
|
| 8 | static unsigned const MAX_VACUUM_POINTS = 8; |
10 | static unsigned const MAX_VACUUM_POINTS = 8; |
| 9 | 11 | ||
| 10 | #if defined __cplusplus |
12 | #if defined __cplusplus |
| 11 | extern "C" |
13 | extern "C" |
| 12 | { |
14 | { |
| Line 21... | Line 23... | ||
| 21 | void setTimingAdjust(int8_t adjust); |
23 | void setTimingAdjust(int8_t adjust); |
| 22 | 24 | ||
| 23 | /// @brief Get timing map RPM column heading |
25 | /// @brief Get timing map RPM column heading |
| 24 | /// @param i column number |
26 | /// @param i column number |
| 25 | /// @return Value at that position |
27 | /// @return Value at that position |
| 26 | int16_t getRpmMap(int i); |
28 | int16_t getRpmMap(unsigned int i); |
| 27 | 29 | ||
| 28 | /// @brief Set the timing map RPM column heading |
30 | /// @brief Set the timing map RPM column heading |
| 29 | /// @param i column number |
31 | /// @param i column number |
| 30 | /// @param value Value to place at that position |
32 | /// @param value Value to place at that position |
| 31 | void setRpmMap(int i, uint16_t value); |
33 | void setRpmMap(unsigned int i, uint16_t value); |
| 32 | 34 | ||
| 33 | /// @brief Set vacuum mapping column heading (row actually) |
35 | /// @brief Set vacuum mapping column heading (row actually) |
| 34 | /// @param i row number |
36 | /// @param i row number |
| 35 | /// @param value Value to place at that position |
37 | /// @param value Value to place at that position |
| 36 | void setVacuumMap(int i, uint16_t value); |
38 | void setVacuumMap(unsigned int i, uint16_t value); |
| 37 | 39 | ||
| 38 | /// @brief Get vacuum mapping column heading (row actually) |
40 | /// @brief Get vacuum mapping column heading (row actually) |
| 39 | /// @param i row number |
41 | /// @param i row number |
| 40 | uint16_t getVacuumMap(int i); |
42 | uint16_t getVacuumMap(unsigned int i); |
| 41 | 43 | ||
| 42 | /// @brief Set the timing value |
44 | /// @brief Set the timing value |
| 43 | /// @param vacuumIndex |
45 | /// @param vacuumIndex |
| 44 | /// @param rpmIndex |
46 | /// @param rpmIndex |
| 45 | /// @param value |
47 | /// @param value |
| 46 | void setTiming(int vacuumIndex, int rpmIndex, uint8_t value); |
48 | void setTiming(unsigned int vacuumIndex, unsigned int rpmIndex, uint8_t value); |
| 47 | 49 | ||
| 48 | /// @brief Get the timing value |
50 | /// @brief Get the timing value |
| 49 | /// @param vacuumIndex |
51 | /// @param vacuumIndex |
| 50 | /// @param rpmIndex |
52 | /// @param rpmIndex |
| 51 | /// @return value |
53 | /// @return value |
| 52 | uint8_t getTiming(int vacuumIndex, int rpmIndex); |
54 | uint8_t getTiming(unsigned int vacuumIndex, unsigned int rpmIndex); |
| 53 | 55 | ||
| 54 | /// @brief Lookup ignition timing |
56 | /// @brief Lookup ignition timing |
| 55 | /// @param rpm Engine Speed in RPM |
57 | /// @param rpm Engine Speed in RPM |
| 56 | /// @param vacuumMb Ported vacuum in millibars of vacuum |
58 | /// @param vacuumMb Ported vacuum in millibars of vacuum : between about 0 and 700 usually |
| 57 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
59 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
| 58 | int mapTiming(int rpm, int vacuumMb); |
60 | int mapTiming(int rpm, int vacuumMb); |
| 59 | #if defined __cplusplus |
61 | #if defined __cplusplus |
| 60 | } |
62 | } |
| 61 | #endif |
63 | #endif |