From 7d8188d0bfae267ed46a070233327742e69093cb Mon Sep 17 00:00:00 2001 From: FindWaySociety-ykla Date: Tue, 7 Apr 2020 17:19:45 +0800 Subject: [PATCH] Add piMemorySize for rpi4 #include 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.*\ --- wiringPi/wiringPi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index 46c6826..c3b9d8b 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -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