Mistři v programování na #hovnokod

Zas nějaký takyprogramátor.

 // Init (for tests start out side of actual source code (sector 0...4) => Sector 5,6 and 7)
   Akt_Sektor    = 5;
        if (Akt_Sektor == 0) Update.SW.Ptr = (unsigned long*) 0x08000000;
   else if (Akt_Sektor == 1) Update.SW.Ptr = (unsigned long*) 0x08004000;
   else if (Akt_Sektor == 2) Update.SW.Ptr = (unsigned long*) 0x08008000;
   else if (Akt_Sektor == 3) Update.SW.Ptr = (unsigned long*) 0x0800C000;
   else if (Akt_Sektor == 4) Update.SW.Ptr = (unsigned long*) 0x08010000;
   else if (Akt_Sektor == 5) Update.SW.Ptr = (unsigned long*) 0x08020000;
   else if (Akt_Sektor == 6) Update.SW.Ptr = (unsigned long*) 0x08040000;
   else                      Update.SW.Ptr = (unsigned long*) 0x08060000;

   // Unlock Flash
   (*FLASH).KEYR = 0x45670123;
   (*FLASH).KEYR = 0xCDEF89AB;

   // Wait for the BSY bit to be cleared
   while ( ((*FLASH).SR & (0x01 << 16)) == (0x01 << 16) )
         { __NOP; }

Anonymous,

char hex2bin(char hex) {
  if(hex == 0x00) return 0;
  if(hex == 0x01) return 1;
  if(hex == 0x02) return 2;
  if(hex == 0x03) return 3;
  ...
  if(hex == 0xfe) return 254;
  if(hex == 0xff) return 255;
  return 0; // other number
}

Anonymous,


Petr Balzer,

Achjo

typedef int petrpica;
typedef int petrpicec;
petrpica a;
petrpicec b;
cout<< "Zadejte cislo: "<<endl;
cin>> petrpica >> petrpicec;

Anonymous,

Ve zdrojáku zůstalo více než 7 let.

	if (pRlPDt->noclst == 0xcdcdcdcd) { //toto zatim pro osetreni havarie vno 19.10.!!!+-9/6*-
		return;
	}

Anonymous,