72
72
uint16_t CodeProfiler::call_count = 0 ;
73
73
#endif
74
74
75
+ #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
76
+ static int16_t last_head_cnt = 0xF , last_tail_cnt = 0xF ;
77
+ #else
78
+ #ifdef MAX7219_DEBUG_PLANNER_HEAD
79
+ static int16_t last_head_cnt = 0x1 ;
80
+ #endif
81
+ #ifdef MAX7219_DEBUG_PLANNER_TAIL
82
+ static int16_t last_tail_cnt = 0x1 ;
83
+ #endif
84
+ #endif
85
+ #ifdef MAX7219_DEBUG_PLANNER_QUEUE
86
+ static int16_t last_depth = 0 ;
87
+ #endif
88
+ #ifdef MAX7219_DEBUG_PROFILE
89
+ static uint8_t last_time_fraction = 0 ;
90
+ #endif
91
+ #ifdef MAX7219_DEBUG_MULTISTEPPING
92
+ static uint8_t last_multistepping = 0 ;
93
+ #endif
94
+
75
95
Max7219 max7219;
76
96
77
97
uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 };
@@ -550,6 +570,29 @@ void Max7219::init() {
550
570
#if MAX7219_INIT_TEST
551
571
start_test_pattern ();
552
572
#endif
573
+
574
+ #ifdef MAX7219_REINIT_ON_POWERUP
575
+ #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
576
+ last_head_cnt = 0xF ;
577
+ last_tail_cnt = 0xF ;
578
+ #else
579
+ #ifdef MAX7219_DEBUG_PLANNER_HEAD
580
+ last_head_cnt = 0x1 ;
581
+ #endif
582
+ #ifdef MAX7219_DEBUG_PLANNER_TAIL
583
+ last_tail_cnt = 0x1 ;
584
+ #endif
585
+ #endif
586
+ #ifdef MAX7219_DEBUG_PLANNER_QUEUE
587
+ last_depth = 0 ;
588
+ #endif
589
+ #ifdef MAX7219_DEBUG_PROFILE
590
+ last_time_fraction = 0 ;
591
+ #endif
592
+ #ifdef MAX7219_DEBUG_MULTISTEPPING
593
+ last_multistepping = 0 ;
594
+ #endif
595
+ #endif
553
596
}
554
597
555
598
/* *
@@ -676,8 +719,6 @@ void Max7219::idle_tasks() {
676
719
677
720
#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
678
721
679
- static int16_t last_head_cnt = 0xF , last_tail_cnt = 0xF ;
680
-
681
722
if (last_head_cnt != head || last_tail_cnt != tail) {
682
723
range16 (MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head, &row_change_mask);
683
724
last_head_cnt = head;
@@ -687,15 +728,13 @@ void Max7219::idle_tasks() {
687
728
#else
688
729
689
730
#ifdef MAX7219_DEBUG_PLANNER_HEAD
690
- static int16_t last_head_cnt = 0x1 ;
691
731
if (last_head_cnt != head) {
692
732
mark16 (MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head, &row_change_mask);
693
733
last_head_cnt = head;
694
734
}
695
735
#endif
696
736
697
737
#ifdef MAX7219_DEBUG_PLANNER_TAIL
698
- static int16_t last_tail_cnt = 0x1 ;
699
738
if (last_tail_cnt != tail) {
700
739
mark16 (MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail, &row_change_mask);
701
740
last_tail_cnt = tail;
@@ -714,7 +753,6 @@ void Max7219::idle_tasks() {
714
753
#endif
715
754
716
755
#ifdef MAX7219_DEBUG_PROFILE
717
- static uint8_t last_time_fraction = 0 ;
718
756
const uint8_t current_time_fraction = (uint16_t (CodeProfiler::get_time_fraction ()) * MAX7219_NUMBER_UNITS + 8 ) / 16 ;
719
757
if (current_time_fraction != last_time_fraction) {
720
758
quantity (MAX7219_DEBUG_PROFILE, last_time_fraction, current_time_fraction, &row_change_mask);
0 commit comments