File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 10201020#endif
10211021
10221022// Helper macros for extruder and hotend arrays
1023- #define EXTRUDER_LOOP () for (int8_t e = 0; e < EXTRUDERS; e++)
1024- #define HOTEND_LOOP () for (int8_t e = 0; e < HOTENDS; e++)
1023+ #define _EXTRUDER_LOOP (E ) for (int8_t E = 0; E < EXTRUDERS; E++)
1024+ #define EXTRUDER_LOOP () _EXTRUDER_LOOP(e)
1025+ #define _HOTEND_LOOP (H ) for (int8_t H = 0; H < HOTENDS; H++)
1026+ #define HOTEND_LOOP () _HOTEND_LOOP(e)
1027+
10251028#define ARRAY_BY_EXTRUDERS (V ...) ARRAY_N(EXTRUDERS, V)
10261029#define ARRAY_BY_EXTRUDERS1 (v1 ) ARRAY_N_1(EXTRUDERS, v1)
10271030#define ARRAY_BY_HOTENDS (V ...) ARRAY_N(HOTENDS, V)
Original file line number Diff line number Diff line change @@ -2374,7 +2374,7 @@ void Temperature::updateTemperaturesFromRawValues() {
23742374 TERN_ (HAS_POWER_MONITOR, power_monitor.capture_values ());
23752375
23762376 #if HAS_HOTEND
2377- static constexpr int8_t temp_dir[] = {
2377+ static constexpr int8_t temp_dir[HOTENDS ] = {
23782378 #if TEMP_SENSOR_IS_ANY_MAX_TC(0)
23792379 0
23802380 #else
@@ -2386,19 +2386,21 @@ void Temperature::updateTemperaturesFromRawValues() {
23862386 #else
23872387 , TEMPDIR (1 )
23882388 #endif
2389+ #endif
2390+ #if HOTENDS > 2
23892391 #if TEMP_SENSOR_IS_ANY_MAX_TC(2)
23902392 , 0
23912393 #else
23922394 , TEMPDIR (2 )
23932395 #endif
2394- # if HOTENDS > 3
2395- # define _TEMPDIR ( N ) , TEMPDIR(N)
2396- REPEAT_S ( 3 , HOTENDS, _TEMPDIR )
2397- # endif
2396+ # endif
2397+ # if HOTENDS > 3
2398+ # define _TEMPDIR ( N ) , TEMPDIR(N )
2399+ REPEAT_S ( 3 , HOTENDS, _TEMPDIR)
23982400 #endif
23992401 };
24002402
2401- LOOP_L_N (e, COUNT (temp_dir) ) {
2403+ HOTEND_LOOP ( ) {
24022404 const raw_adc_t r = temp_hotend[e].getraw ();
24032405 const bool neg = temp_dir[e] < 0 , pos = temp_dir[e] > 0 ;
24042406 if ((neg && r < temp_range[e].raw_max ) || (pos && r > temp_range[e].raw_max ))
You can’t perform that action at this time.
0 commit comments