16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 11:19:19 +02:00

reformat: parameters can be made const

This commit is contained in:
jerrrrycho
2026-07-04 07:08:14 +02:00
parent 6fd1d6715b
commit 220689a5e3
121 changed files with 1380 additions and 1352 deletions

View File

@@ -23,7 +23,7 @@ typedef void(__stdcall *OutPortType)(USHORT BasePort, USHORT value);
InPortType InPort;
OutPortType OutPort;
bool TLPT::Connect(int port)
bool TLPT::Connect(const int port)
{
WriteLog("lpt: trying to connect lpt, port " + std::to_string(port));
@@ -57,7 +57,7 @@ bool TLPT::Connect(int port)
return OutPort != 0;
};
void TLPT::Out(int x)
void TLPT::Out(const int x)
{ // wysłanie bajtu do portu
OutPort(address, x);
};

View File

@@ -201,7 +201,7 @@ bool TPoKeys55::Connect()
return false;
}
//---------------------------------------------------------------------------
bool TPoKeys55::Write(unsigned char c, unsigned char b3, unsigned char b4, unsigned char b5)
bool TPoKeys55::Write(const unsigned char c, const unsigned char b3, const unsigned char b4, const unsigned char b5)
{
DWORD BytesWritten = 0;
OutputBuffer[0] = 0; // The first byte is the "Report ID" and does not get transmitted over the
@@ -287,14 +287,14 @@ std::string TPoKeys55::Version()
return "";
};
bool TPoKeys55::PWM(int x, float y)
bool TPoKeys55::PWM(const int x, const float y)
{ // ustawienie wskazanego PWM (@12Mhz: 12000=1ms=1000Hz)
// iPWM[7]=1024; //1024==85333.3333333333ns=11718.75Hz
iPWM[x] = int(0.5f + 0x0FFF * y) & 0x0FFF; // 0x0FFF=4095
return true;
}
bool TPoKeys55::Update(bool pause)
bool TPoKeys55::Update(const bool pause)
{ // funkcja powinna być wywoływana regularnie, np. raz w każdej ramce ekranowej
if (pause)
{ // specjalna procedura, jeśli utracone połączenie spowodowało pauzę