Sfoglia il codice sorgente

Add piMemorySize for rpi4

#include <stdio.h>

int main()
{
	int bRev, bType, bProc, bMfg, bMem, bWarranty ;
	int revision = 12595474; //Convert hexadecimal to decimal
	bRev      = (revision & (0x0F <<  0)) >>  0 ;
        bType     = (revision & (0xFF <<  4)) >>  4 ;
        bProc     = (revision & (0x0F << 12)) >> 12 ;	// Not used for now.
        bMfg      = (revision & (0x0F << 16)) >> 16 ;
        bMem      = (revision & (0x07 << 20)) >> 20 ;
       bWarranty = (revision & (0x03 << 24)) != 0 ;
       printf ("piBoardId: rev: %d, type: %d, proc: %d, mfg: %d, mem: %d, warranty: %d\n",
		bRev, bType, bProc, bMfg, bMem, bWarranty) ;

   return 0;
}

/* revision see https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md 
*RPI revision is HEX.*\
pull/75/head
FindWaySociety-ykla 4 anni fa
committed by GitHub
parent
commit
7d8188d0bf
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      wiringPi/wiringPi.c

+ 2
- 2
wiringPi/wiringPi.c Vedi File

@@ -288,8 +288,8 @@ const int piMemorySize [8] =
256, // 0
512, // 1
1024, // 2
0, // 3
0, // 4
2048, // 3
4096, // 4
0, // 5
0, // 6
0, // 7


Caricamento…
Annulla
Salva