Files
BloomPatched/build/scripts/Targets/TargetDescriptionFiles/AVR8/Signature.php

23 lines
638 B
PHP
Raw Normal View History

<?php
namespace Targets\TargetDescriptionFiles\Avr8;
class Signature
{
public ?int $byteZero = null;
public ?int $byteOne = null;
public ?int $byteTwo = null;
public function toHex(): string
{
if ($this->byteZero === null || $this->byteOne === null || $this->byteTwo === null) {
throw new \Exception("Cannot generate hex string of incomplete AVR8 target signature.");
}
2024-07-07 17:50:43 +01:00
return '0x' . strtoupper(
substr('0' . dechex($this->byteZero), -2)
. substr('0' . dechex($this->byteOne), -2)
. substr('0' . dechex($this->byteTwo), -2)
2024-07-07 17:50:43 +01:00
);
}
}