Prusa MINI Firmware overview
ClValidityValueSec Class Reference

#include <M73_PE.h>

Inheritance diagram for ClValidityValueSec:
Collaboration diagram for ClValidityValueSec:

Public Member Functions

void mFormatSeconds (char *sStr, uint16_t nFeedrate)
 
- Public Member Functions inherited from ClValidityValue
void mSetValue (uint32_t nN, uint32_t nNow)
 
uint32_t mGetValue (void)
 
void mInit (void)
 
bool mIsActual (uint32_t nNow)
 
bool mIsActual (uint32_t nNow, uint16_t nPeriod)
 
bool mIsUsed (void)
 

Additional Inherited Members

- Protected Attributes inherited from ClValidityValue
uint32_t nValue
 
uint32_t nTime =0
 
bool bIsUsed =false
 

Member Function Documentation

◆ mFormatSeconds()

void ClValidityValueSec::mFormatSeconds ( char *  sStr,
uint16_t  nFeedrate 
)
55 {
56 uint8_t nDay,nHour,nMin;
57 uint32_t nRest;
58 
59 nRest=(nValue*100)/nFeedrate;
60 nDay=nRest/(60*60*24);
61 nRest=nRest%(60*60*24);
62 nHour=nRest/(60*60);
63 nRest=nRest%(60*60);
64 nMin=nRest/60;
65 if(nDay>0)
66  sprintf_P(sStr,PSTR("%dd %dh"),nDay,nHour);
67 else if(nHour>0)
68  sprintf_P(sStr,PSTR("%dh %dm"),nHour,nMin);
69  else sprintf_P(sStr,PSTR("%dm"),nMin);
70 }
Here is the caller graph for this function:
sprintf_P
#define sprintf_P(s,...)
Definition: pgmspace.h:72
PSTR
#define PSTR(str)
Definition: pgmspace.h:31
uint8_t
const uint8_t[]
Definition: 404_html.c:3
ClValidityValue::nValue
uint32_t nValue
Definition: M73_PE.h:12