|
@@ -78,6 +78,7 @@ uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 };
|
78
|
78
|
#define LED_IND(X,Y) _LED_IND(Y,X)
|
79
|
79
|
#define LED_BIT(X,Y) _LED_BIT(Y)
|
80
|
80
|
#endif
|
|
81
|
+
|
81
|
82
|
#define XOR_7219(X,Y) do{ led_line[LED_IND(X,Y)] ^= _BV(LED_BIT(X,Y)); }while(0)
|
82
|
83
|
#define SET_7219(X,Y) do{ led_line[LED_IND(X,Y)] |= _BV(LED_BIT(X,Y)); }while(0)
|
83
|
84
|
#define CLR_7219(X,Y) do{ led_line[LED_IND(X,Y)] &= ~_BV(LED_BIT(X,Y)); }while(0)
|
|
@@ -464,18 +465,18 @@ void Max7219::init() {
|
464
|
465
|
*/
|
465
|
466
|
|
466
|
467
|
// Apply changes to update a marker
|
467
|
|
-void Max7219::mark16(const uint8_t y, const uint8_t v1, const uint8_t v2) {
|
|
468
|
+void Max7219::mark16(const uint8_t pos, const uint8_t v1, const uint8_t v2) {
|
468
|
469
|
#if MAX7219_X_LEDS == 8
|
469
|
470
|
#if MAX7219_Y_LEDS == 8
|
470
|
|
- led_off(v1 & 0x7, y + (v1 >= 8));
|
471
|
|
- led_on(v2 & 0x7, y + (v2 >= 8));
|
|
471
|
+ led_off(v1 & 0x7, pos + (v1 >= 8));
|
|
472
|
+ led_on(v2 & 0x7, pos + (v2 >= 8));
|
472
|
473
|
#else
|
473
|
|
- led_off(y, v1 & 0xF); // At least 16 LEDs down. Use a single column.
|
474
|
|
- led_on(y, v2 & 0xF);
|
|
474
|
+ led_off(pos, v1 & 0xF); // At least 16 LEDs down. Use a single column.
|
|
475
|
+ led_on(pos, v2 & 0xF);
|
475
|
476
|
#endif
|
476
|
477
|
#else
|
477
|
|
- led_off(v1 & 0xF, y); // At least 16 LEDs across. Use a single row.
|
478
|
|
- led_on(v2 & 0xF, y);
|
|
478
|
+ led_off(v1 & 0xF, pos); // At least 16 LEDs across. Use a single row.
|
|
479
|
+ led_on(v2 & 0xF, pos);
|
479
|
480
|
#endif
|
480
|
481
|
}
|
481
|
482
|
|
|
@@ -502,16 +503,16 @@ void Max7219::range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const
|
502
|
503
|
}
|
503
|
504
|
|
504
|
505
|
// Apply changes to update a quantity
|
505
|
|
-void Max7219::quantity16(const uint8_t y, const uint8_t ov, const uint8_t nv) {
|
|
506
|
+void Max7219::quantity16(const uint8_t pos, const uint8_t ov, const uint8_t nv) {
|
506
|
507
|
for (uint8_t i = _MIN(nv, ov); i < _MAX(nv, ov); i++)
|
507
|
508
|
#if MAX7219_X_LEDS == 8
|
508
|
509
|
#if MAX7219_Y_LEDS == 8
|
509
|
|
- led_set(i >> 1, y + (i & 1), nv >= ov); // single 8x8 LED matrix. Use two lines to get 16 LED's
|
|
510
|
+ led_set(i >> 1, pos + (i & 1), nv >= ov); // single 8x8 LED matrix. Use two lines to get 16 LED's
|
510
|
511
|
#else
|
511
|
|
- led_set(y, i, nv >= ov); // The Max7219 Y-Axis has at least 16 LED's. So use a single column
|
|
512
|
+ led_set(pos, i, nv >= ov); // The Max7219 Y-Axis has at least 16 LED's. So use a single column
|
512
|
513
|
#endif
|
513
|
514
|
#else
|
514
|
|
- led_set(i, y, nv >= ov); // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's
|
|
515
|
+ led_set(i, pos, nv >= ov); // LED matrix has at least 16 LED's on the X-Axis. Use single line of LED's
|
515
|
516
|
#endif
|
516
|
517
|
}
|
517
|
518
|
|