Rev 7 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7 | Rev 12 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | // This file deals with looking up ignition timing |
1 | // This file deals with looking up ignition timing |
2 | 2 | ||
3 | #pragma once |
3 | #pragma once |
4 | #include "stdint.h" |
4 | #include "stdint.h" |
5 | - | ||
6 | static const int TIMING_SCALE = 10; |
- | |
7 | // number of RPM lookup values |
- | |
8 | static unsigned const MAX_RPM_POINTS = 8; |
- | |
9 | // number of vacuum lookup points |
5 | #include "libIgnTiming/basemap.h" |
10 | static unsigned const MAX_VACUUM_POINTS = 8; |
- | |
11 | 6 | ||
12 | #if defined __cplusplus |
7 | #if defined __cplusplus |
13 | extern "C" |
8 | extern "C" |
14 | { |
9 | { |
15 | #endif |
10 | #endif |
16 | 11 | ||
- | 12 | ||
17 | /// @brief Get timing adjustment value |
13 | /// @brief Get timing adjustment value |
18 | /// @return Timing adjustment value |
14 | /// @return Timing adjustment value |
19 | uint8_t getTimingAdjust(); |
15 | uint8_t getTimingAdjust(); |
20 | 16 | ||
21 | /// @brief Set the timing adjustment value |
17 | /// @brief Set the timing adjustment value |
Line 43... | Line 39... | ||
43 | 39 | ||
44 | /// @brief Set the timing value |
40 | /// @brief Set the timing value |
45 | /// @param vacuumIndex |
41 | /// @param vacuumIndex |
46 | /// @param rpmIndex |
42 | /// @param rpmIndex |
47 | /// @param value |
43 | /// @param value |
48 | void setTiming(unsigned int vacuumIndex, unsigned int rpmIndex, uint8_t value); |
44 | void setTiming(unsigned int vacuumIndex, unsigned int rpmIndex, uint8_t value); |
49 | 45 | ||
50 | /// @brief Get the timing value |
46 | /// @brief Get the timing value |
51 | /// @param vacuumIndex |
47 | /// @param vacuumIndex |
52 | /// @param rpmIndex |
48 | /// @param rpmIndex |
53 | /// @return value |
49 | /// @return value |
54 | uint8_t getTiming(unsigned int vacuumIndex, unsigned int rpmIndex); |
50 | uint8_t getTiming(unsigned int vacuumIndex, unsigned int rpmIndex); |
55 | 51 | ||
56 | /// @brief Lookup ignition timing |
52 | /// @brief Lookup ignition timing |
57 | /// @param rpm Engine Speed in RPM |
53 | /// @param rpm Engine Speed in RPM |
58 | /// @param vacuumMb Ported vacuum in millibars of vacuum : between about 0 and 700 usually |
54 | /// @param vacuumMb Ported vacuum in millibars of vacuum : between about 0 and 700 usually |
59 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
55 | /// @return Vacuum advance in degrees * TIMING_SCALE; |
60 | int mapTiming(int rpm, int vacuumMb); |
56 | int mapTiming(int rpm, int vacuumMb); |
- | 57 | ||
- | 58 | /// @brief Set the base timing map |
|
- | 59 | /// @param map Pointer to timing map table |
|
- | 60 | void setBaseMap(timingTable_t *map); |
|
- | 61 | ||
61 | #if defined __cplusplus |
62 | #if defined __cplusplus |
62 | } |
63 | } |
63 | #endif |
64 | #endif |