Rev 14 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 14 | Rev 21 | ||
|---|---|---|---|
| Line 22... | Line 22... | ||
| 22 | { |
22 | { |
| 23 | int const WIDTH = 128; |
23 | int const WIDTH = 128; |
| 24 | int const HEIGHT = 64; |
24 | int const HEIGHT = 64; |
| 25 | int const DISPLAY_RAMWIDTH = 132; |
25 | int const DISPLAY_RAMWIDTH = 132; |
| 26 | 26 | ||
| - | 27 | uint32_t atmPress; // actual atmospheric pressure |
|
| 27 | uint32_t press; // pressure millibar * 100 |
28 | uint32_t press; // pressure millibar * 100 based on normalised pressure |
| 28 | int32_t temp; // temperature * 10 |
29 | int32_t temp; // temperature * 10 |
| 29 | int rpm; // user pressed button |
30 | int rpm; // engine RPM |
| 30 | 31 | ||
| 31 | int timing; // timing value . |
32 | int timing; // timing value . |
| 32 | } |
33 | } |
| 33 | 34 | ||
| 34 | uint8_t displayBuffer[MAX_DISPLAYS][dataSize(WIDTH, HEIGHT)]; |
35 | uint8_t displayBuffer[MAX_DISPLAYS][dataSize(WIDTH, HEIGHT)]; |
| 35 | 36 | ||
| 36 | stm32_halDisplay_t displays[MAX_DISPLAYS] = |
37 | stm32_halDisplay_t displays[MAX_DISPLAYS] = |
| Line 63... | Line 64... | ||
| 63 | display_t &display = displays[i]; |
64 | display_t &display = displays[i]; |
| 64 | if (i == 0) |
65 | if (i == 0) |
| 65 | display.reset(); |
66 | display.reset(); |
| 66 | display.init(); |
67 | display.init(); |
| 67 | display.clearDisplay(BLACK); |
68 | display.clearDisplay(BLACK); |
| 68 | display.gotoxy(8, 32); |
69 | display.gotoxy(8, 32); |
| 69 | display.printString(large_font, "mikeJ", 5, BLACK); |
70 | display.printString(large_font, "mikeJ", 5, BLACK); |
| 70 | display.display(); |
71 | display.display(); |
| 71 | } |
72 | } |
| 72 | } |
73 | } |
| 73 | 74 | ||
| 74 | int |
75 | int |
| Line 92... | Line 93... | ||
| 92 | if (intensity > 0) |
93 | if (intensity > 0) |
| 93 | { |
94 | { |
| 94 | 95 | ||
| 95 | dispXY.drawAxes(); |
96 | dispXY.drawAxes(); |
| 96 | 97 | ||
| 97 | char buff1[10]; |
98 | char buff1[20]; // manifold / atmospheric pressure |
| 98 | char buff2[20]; |
99 | char buff2[20]; // temp / rpm string |
| 99 | char buff[10]; |
100 | char buff[10]; // timing code |
| 100 | 101 | ||
| 101 | small_sprintf(buff, "%2d.%01d", timing / 10, timing % 10); |
102 | small_sprintf(buff, "%2d.%01d", timing / 10, timing % 10); |
| 102 | 103 | ||
| 103 | small_sprintf(buff1, "%4ld.%02ld mb", press / 100, press % 100); |
104 | small_sprintf(buff1, "M%4ld A%4ld.%1ld", press / 100, atmPress / 100,(atmPress/10)%10); |
| 104 | 105 | ||
| 105 | small_sprintf(buff2, "%2ldC %4d rpm", temp / 100, rpm); |
106 | small_sprintf(buff2, "%2ld.%ldC %4drpm", temp / 100, (temp /10) % 10, rpm); |
| 106 | 107 | ||
| 107 | dispXY.plotPoint(rpm, press / 100, buff, buff1, buff2); |
108 | dispXY.plotPoint(rpm, press / 100, buff, buff1, buff2 ); |
| 108 | } |
109 | } |
| 109 | display.display(); |
110 | display.display(); |
| 110 | 111 | ||
| 111 | return 0; |
112 | return 0; |
| 112 | } |
113 | } |
| 113 | 114 | ||
| 114 | void cc_feed_env(uint32_t pressVal, int32_t tempVal) |
115 | void cc_feed_env(uint32_t atmPressVal, uint32_t pressVal, int32_t tempVal) |
| 115 | { |
116 | { |
| - | 117 | atmPress = atmPressVal; |
|
| 116 | press = pressVal; |
118 | press = pressVal; |
| 117 | temp = tempVal; |
119 | temp = tempVal; |
| 118 | } |
120 | } |
| 119 | 121 | ||
| 120 | void cc_feed_timing(int timing_) |
122 | void cc_feed_timing(int timing_) |