@@ -19,27 +19,27 @@ struct DebugGpioPort : public Port
1919 static void dumpShifts ()
2020 {
2121 for (int ii=0 ; ii<7 ; ii++) {
22- serialStream << char (ii+' A' ) << " {" ;
22+ MODM_LOG_INFO << char (ii+' A' ) << " {" ;
2323 for (int jj=0 ; jj<Port::width; jj++) {
2424 const auto p = Port::shift_masks[ii][jj];
25- serialStream << " " ;
26- if (p >= 0 ) { serialStream << p; }
27- else { serialStream << " " ; }
28- serialStream << " " ;
29- if (jj != Port::width - 1 ) { serialStream << " ," ; }
25+ MODM_LOG_INFO << " " ;
26+ if (p >= 0 ) { MODM_LOG_INFO << p; }
27+ else { MODM_LOG_INFO << " " ; }
28+ MODM_LOG_INFO << " " ;
29+ if (jj != Port::width - 1 ) { MODM_LOG_INFO << " ," ; }
3030 }
31- serialStream << " }" << modm::endl;
31+ MODM_LOG_INFO << " }" << modm::endl;
3232 }
3333 }
3434
3535 static void dumpMasks ()
3636 {
3737 for (int ii=0 ; ii<7 ; ii++) {
38- serialStream << char (ii+' A' ) << " " << modm::bin << Port::mask (ii) << modm::endl;
38+ MODM_LOG_INFO << char (ii+' A' ) << " " << modm::bin << Port::mask (ii) << modm::endl;
3939 }
40- serialStream << modm::endl;
40+ MODM_LOG_INFO << modm::endl;
4141 for (int ii=0 ; ii<7 ; ii++) {
42- serialStream << char (ii+' A' ) << " " << modm::bin << Port::inverted (ii) << modm::endl;
42+ MODM_LOG_INFO << char (ii+' A' ) << " " << modm::bin << Port::inverted (ii) << modm::endl;
4343 }
4444 }
4545};
@@ -64,23 +64,23 @@ int main()
6464 static_assert (PinGroup3::number_of_ports == 1 );
6565 static_assert (PinGroup4::number_of_ports == 1 );
6666
67- DebugGpioPort<PinGroup>::dumpMasks (); serialStream << modm::endl;
68- DebugGpioPort<PinGroup2>::dumpMasks (); serialStream << modm::endl;
69- DebugGpioPort<PinGroup3>::dumpMasks (); serialStream << modm::endl;
70- DebugGpioPort<PinGroup4>::dumpMasks (); serialStream << modm::endl;
67+ DebugGpioPort<PinGroup>::dumpMasks (); MODM_LOG_INFO << modm::endl;
68+ DebugGpioPort<PinGroup2>::dumpMasks (); MODM_LOG_INFO << modm::endl;
69+ DebugGpioPort<PinGroup3>::dumpMasks (); MODM_LOG_INFO << modm::endl;
70+ DebugGpioPort<PinGroup4>::dumpMasks (); MODM_LOG_INFO << modm::endl;
7171
72- DebugGpioPort<PinGroup>::dumpShifts (); serialStream << modm::endl;
73- DebugGpioPort<PinGroup2>::dumpShifts (); serialStream << modm::endl;
72+ DebugGpioPort<PinGroup>::dumpShifts (); MODM_LOG_INFO << modm::endl;
73+ DebugGpioPort<PinGroup2>::dumpShifts (); MODM_LOG_INFO << modm::endl;
7474
75- PinGroup2::setInput (); serialStream << modm::bin << PinGroup2::read () << modm::endl;
76- PinGroup3::setInput (); serialStream << modm::bin << PinGroup3::read () << modm::endl;
77- PinGroup4::setInput (); serialStream << modm::bin << PinGroup4::read () << modm::endl;
78- serialStream << modm::endl;
75+ PinGroup2::setInput (); MODM_LOG_INFO << modm::bin << PinGroup2::read () << modm::endl;
76+ PinGroup3::setInput (); MODM_LOG_INFO << modm::bin << PinGroup3::read () << modm::endl;
77+ PinGroup4::setInput (); MODM_LOG_INFO << modm::bin << PinGroup4::read () << modm::endl;
78+ MODM_LOG_INFO << modm::endl;
7979
8080 PinGroup::setOutput (modm::Gpio::High); modm::delay (1s);
8181
8282 const auto fn_report = []() {
83- serialStream << modm::bin << PinGroup::read () << modm::endl; modm::delay (200ms);
83+ MODM_LOG_INFO << modm::bin << PinGroup::read () << modm::endl; modm::delay (200ms);
8484 };
8585
8686 while (true )
@@ -91,14 +91,14 @@ int main()
9191 PinGroup::write (0b00111 ); fn_report ();
9292 PinGroup::write (0b01111 ); fn_report ();
9393 PinGroup::write (0b11111 ); fn_report ();
94- serialStream << modm::endl;
94+ MODM_LOG_INFO << modm::endl;
9595
9696 PinGroup::reset ();
9797 Pin0::set (); fn_report ();
9898 Pin1::set (); fn_report ();
9999 Pin2::set (); fn_report ();
100100 Pin3::set (); fn_report ();
101- serialStream << modm::endl;
101+ MODM_LOG_INFO << modm::endl;
102102
103103 // while (true);
104104 }
0 commit comments