void TemperatureWriter::redraw(FlashGraphics& flash,const Point& p,const DefaultTemperatureReader::Result& result) {

    uint16_t width;

    if(result.Status==DefaultTemperatureReader::Result::NO_ERROR) {
      
      // clear broken symbol
      
      Panel::LcdPanel& gl(flash.getGraphicsLibrary());

      gl.setBackground(_backgroundColour);
      gl.clearRectangle(Rectangle(p.X+_brokenIconOffset.Width,p.Y+_height-BROKEN_HEIGHT+_brokenIconOffset.Height,_digits[BROKEN].Width,BROKEN_HEIGHT));

      // write the number

      width=IntegerNumberWriter::write(flash,p,result.Temperature);

      // write the degrees C symbol

      flash.drawBitmap(
          Rectangle(p.X+width,p.Y,_digits[DEGREES_C].Width,_height),
          _digits[DEGREES_C].FlashAddress,
          _digits[DEGREES_C].Length);

      width+=_digits[DEGREES_C].Width;

      // erase any background overhang from last time

      if(width<_lastWidth) {

        Panel::LcdPanel& gl(flash.getGraphicsLibrary());

        gl.setBackground(_backgroundColour);
        gl.clearRectangle(Rectangle(p.X+width,p.Y,_lastWidth-width,_height));
      }

      _lastWidth=width;
    }
    else {
      
      // erase any background overhang from last time it shows a temperature value
      
      Panel::LcdPanel& gl(flash.getGraphicsLibrary());

      gl.setBackground(_backgroundColour);
      gl.clearRectangle(Rectangle(p.X,p.Y,_brokenIconOffset.Width,_height));

      // there's something wrong with the comms, show a "broken" icon

      flash.drawBitmap(
          Rectangle(p.X+_brokenIconOffset.Width,p.Y+_height-BROKEN_HEIGHT+_brokenIconOffset.Height,_digits[BROKEN].Width,BROKEN_HEIGHT),
          _digits[BROKEN].FlashAddress,
          _digits[BROKEN].Length);
    }
  }