Skip to content

Commit eba215c

Browse files
committed
Add real world example to github issues including the fix
1 parent 89f236d commit eba215c

5 files changed

Lines changed: 51 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Start creating stunning effects immediately on both mobile and desktop.
152152
### Version 0.9.0 - March 2026
153153
**FastLED Channels API, FastLED Audio, sensors and palettes**
154154

155-
See [v0.9.0 Kanban board](https://github.com/users/MoonModules/projects/4) or log an [Issue](https://github.com/MoonModules/MoonLight/issues/new/choose) to report issues or request enhancements.
155+
See [v1.0.0 Kanban board](https://github.com/users/MoonModules/projects/4) or log an [Issue](https://github.com/MoonModules/MoonLight/issues/new/choose) to report issues or request enhancements.
156156

157157
---
158158

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Start creating stunning effects immediately on both mobile and desktop.
158158
### Version 0.9.0 - March 2026
159159
**FastLED Channels API, FastLED Audio, sensors and palettes**
160160

161-
See [v0.9.0 Kanban board](https://github.com/users/MoonModules/projects/4) or log an [Issue](moonlight/overview.md#reporting-issues) to report issues or request enhancements.
161+
See [v1.0.0 Kanban board](https://github.com/users/MoonModules/projects/4) or log an [Issue](moonlight/overview.md#reporting-issues) to report issues or request enhancements.
162162

163163
---
164164

docs/moonlight/overview.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ Found a bug or want to request a feature?
151151

152152
### Bug report template
153153

154+
See [A github issue](https://github.com/MoonModules/MoonLight/issues/164) for an example.
155+
154156
**1. Describe the problem**
155157

156158
```
@@ -176,17 +178,45 @@ The API output is a JSON snapshot of your device state — ⚠️ **this is the
176178
2. Click the **API icon** (↔) at the bottom-right of the module card
177179
3. Copy the entire JSON, paste it in your issue in a code block
178180

179-
**Always include the API output of these three:**
181+
**Include the following API output:**
180182

181-
1. [System status](../system/status.md)
182-
2. [MoonLight Info](./moonlightinfo.md)
183-
3. Affected module, e.g.:
183+
1. Always: [System status](../system/status.md)
184+
2. If lights related: [MoonLight Info](./moonlightinfo.md)
185+
3. If pins related: [Board preset](../moonbase/inputoutput.md)
186+
4. If drivers related: [Drivers](./drivers.md)
187+
5. Affected module, e.g.:
184188

185189
- [Effects](./effects.md)
186-
- [Drivers](./drivers.md)
187190
- [Lights Control](./lightscontrol.md)
188191
- [Channels](./channels.md)
189192

193+
use ```text to have all the output on one line to avoid very long issue texts like this:
194+
195+
````text
196+
API output:
197+
198+
- System status
199+
```text
200+
{"esp_platform":"ESP32-S3","firmware_version":"0.9.1","firmware_date":"20260406","firmware_target":"esp32-s3-n8r8v","platform_version":"pioarduino-55.03.37","ma...}
201+
```
202+
203+
- MoonLight info
204+
```text
205+
{"nrOfLights":256,"channelsPerLight":3,"nrOfChannels":768,"size":{"x":16,"y":16,"z":1},"nodes#":2,"layers":...}
206+
```
207+
208+
- Module IO Board preset
209+
```text
210+
{"boardPreset":"LightCrafter16","modded":false,"maxPower":500,"pins":...}
211+
```
212+
213+
- Module Drivers
214+
```text
215+
{"nodes":[{"name":"Panel ⏹️ 🚥","on":true,"controls":[{"name":"panelWidth","value":16,"default":16,"p":1009379704,"type":"number","valid":true,"min":1,"max":65536,"size":16},]}]...}
216+
```
217+
218+
````
219+
190220
**3. Ask for analysis (optional)**
191221

192222
Add a comment to your issue:

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ build_flags =
117117

118118
-D NROF_END_POINTS=160 ; 💫 sets _server->config.max_uri_handlers. increase number of endpoints to 160, default is 120, one PsychicEndpoint is 56 bytes -> 8960 bytes
119119

120-
; -O2
120+
; -O2
121121
; Speed optimization.
122122
; On ESP32 (Xtensa), this aggressively inlines functions and expands templates,
123123
; which can greatly increase function size.

src/MoonBase/Modules/ModuleIO.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,9 @@ class ModuleIO : public Module {
10611061

10621062
adc_attenuation_t voltage_readout_current_adc_attenuation = ADC_11db;
10631063
adc_attenuation_t current_readout_current_adc_attenuation = ADC_11db;
1064+
adc_attenuation_t _savedVoltageAttenuation = (adc_attenuation_t)0xFF; // invalid = force first set
1065+
adc_attenuation_t _savedCurrentAttenuation = (adc_attenuation_t)0xFF; // invalid = force first set
1066+
10641067
#endif
10651068

10661069
// cppcheck-suppress uselessOverride -- has content when FT_BATTERY is defined
@@ -1074,9 +1077,12 @@ class ModuleIO : public Module {
10741077
batteryService->updateSOC(perc * 100);
10751078
}
10761079
if (_pinVoltage != UINT8_MAX) {
1077-
analogSetAttenuation(voltage_readout_current_adc_attenuation);
1080+
if (voltage_readout_current_adc_attenuation != _savedVoltageAttenuation) {
1081+
analogSetPinAttenuation(_pinVoltage, voltage_readout_current_adc_attenuation);
1082+
_savedVoltageAttenuation = voltage_readout_current_adc_attenuation;
1083+
}
10781084
uint32_t adc_mv_vinput = analogReadMilliVolts(_pinVoltage);
1079-
analogSetAttenuation(ADC_11db);
1085+
// No reset to ADC_11db needed — pin-specific attenuation is persistent
10801086
float volts = 0;
10811087
if (_currentBoardPreset == BoardName::SE16V1) {
10821088
volts = ((float)adc_mv_vinput) * 2 / 1000;
@@ -1088,9 +1094,12 @@ class ModuleIO : public Module {
10881094
voltage_readout_current_adc_attenuation = adc_get_adjusted_gain(voltage_readout_current_adc_attenuation, adc_mv_vinput);
10891095
}
10901096
if (_pinCurrent != UINT8_MAX) {
1091-
analogSetAttenuation(current_readout_current_adc_attenuation);
1097+
if (current_readout_current_adc_attenuation != _savedCurrentAttenuation) {
1098+
analogSetPinAttenuation(_pinCurrent, current_readout_current_adc_attenuation);
1099+
_savedCurrentAttenuation = current_readout_current_adc_attenuation;
1100+
}
10921101
uint32_t adc_mv_cinput = analogReadMilliVolts(_pinCurrent);
1093-
analogSetAttenuation(ADC_11db);
1102+
// No reset to ADC_11db needed
10941103
current_readout_current_adc_attenuation = adc_get_adjusted_gain(current_readout_current_adc_attenuation, adc_mv_cinput);
10951104
if ((_currentBoardPreset == BoardName::SE16V1) || (_currentBoardPreset == BoardName::LightCrafter16)) {
10961105
if (adc_mv_cinput > 330) // datasheet quiescent output voltage of 0.5V, which is ~330mV after the 10k/5k1 voltage divider. Ideally, this value should be measured at boot when nothing is displayed on the LEDs

0 commit comments

Comments
 (0)