MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / THROWS

Function THROWS

src/Display/Display.cpp:190–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void Display::InitDisplay(GCodeBuffer& gb, Lcd *_ecv_from newLcd, Pin csPin, Pin a0Pin, bool defaultCsPolarity) THROWS(GCodeException)
191{
192 // ST7567-based displays need a resistor ratio setting and a contrast setting
193 // For now we always pass these as parameters toLcd::Init(). If we get any more, consider passing the GCodeBuffer and letting the display pick the parameters instead.
194 const uint32_t contrast = (gb.Seen('C')) ? gb.GetUIValue() : DefaultDisplayContrastRatio;
195 const uint32_t resistorRatio = (gb.Seen('R')) ? gb.GetUIValue() : DefaultDisplayResistorRatio;
196 newLcd->Init(csPin, a0Pin, defaultCsPolarity, (gb.Seen('F')) ? gb.GetUIValue() : LcdSpiClockFrequency, contrast, resistorRatio);
197 StopBeep(); // this serves to initialise the pins
198
199 newLcd->SetFont(SmallFontNumber);
200
201#if SUPPORT_ROTARY_ENCODER
202 if (encoder == nullptr)
203 {
204 encoder = new RotaryEncoder(EncoderPinA, EncoderPinB, EncoderPinSw);
205 encoder->Init(DefaultPulsesPerClick);
206 }
207#endif
208
209 menu = new Menu(*newLcd);
210 menu->Load("main");
211 lcd = newLcd;
212}
213
214GCodeResult Display::Configure(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeException)
215{

Callers 1

Display.hFile · 0.70

Calls 12

SetFontMethod · 0.80
copyMethod · 0.80
BoardsUpdatedMethod · 0.80
catMethod · 0.80
catfMethod · 0.80
SeenMethod · 0.45
InitMethod · 0.45
LoadMethod · 0.45
printfMethod · 0.45
GetColourBitsMethod · 0.45
GetControllerTypeMethod · 0.45
GetSpiFrequencyMethod · 0.45

Tested by

no test coverage detected