replace % with & to save space require to compile with newer SDCC

This commit is contained in:
King Kévin 2020-10-07 13:19:42 +02:00
parent c245295cc3
commit 157a8ee41f
1 changed files with 7 additions and 7 deletions

View File

@ -82,15 +82,15 @@ uint8_t read_eeprom(uint8_t address) {
/* transmit the megacode */
void megacode (void) {
static uint8_t byte;
uint8_t bit = phase/4;
uint8_t bit = phase / 4;
if (transmit != 0) {
if (bit%8==0) { // read byte to transmit
byte = read_eeprom(bit/8);
if (bit & 0x7 == 0) { // read byte to transmit
byte = read_eeprom(bit / 8);
}
if (bit<24) { // transmit bit
if (phase%2) {
uint8_t pulse = (byte>>((23-bit)%8))&0x01;
if ((phase%4==1 && !pulse) || (phase%4==3 && pulse)) {
if (bit < 24) { // transmit bit
if (phase & 0x1) {
uint8_t pulse = (byte >> ((23 - bit) & 0x7)) & 0x01;
if ((phase & 0x3 == 1 && !pulse) || (phase & 0x3 == 3 && pulse)) {
led_off();
tx_on();
}