mirror of https://github.com/joan2937/pigpio
V70+: Merge branch 'CreaValix-master'
This commit is contained in:
commit
21859bf092
34
pigpio.c
34
pigpio.c
|
@ -6953,6 +6953,7 @@ static void *pthSocketThreadHandler(void *fdC)
|
|||
{
|
||||
int sock = *(int*)fdC;
|
||||
uintptr_t p[10];
|
||||
uint32_t tmp;
|
||||
int opt;
|
||||
char buf[CMD_MAX_EXTENSION];
|
||||
|
||||
|
@ -6963,8 +6964,22 @@ static void *pthSocketThreadHandler(void *fdC)
|
|||
setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char*)&opt, sizeof(int));
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (sizeof(uintptr_t) == 8)
|
||||
{
|
||||
if (recv(sock, &tmp, 4, MSG_WAITALL) != 4) break;
|
||||
p[0] = (uintptr_t)tmp;
|
||||
if (recv(sock, &tmp, 4, MSG_WAITALL) != 4) break;
|
||||
p[1] = (uintptr_t)tmp;
|
||||
if (recv(sock, &tmp, 4, MSG_WAITALL) != 4) break;
|
||||
p[2] = (uintptr_t)tmp;
|
||||
if (recv(sock, &tmp, 4, MSG_WAITALL) != 4) break;
|
||||
p[3] = (uintptr_t)tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (recv(sock, p, 16, MSG_WAITALL) != 16) break;
|
||||
}
|
||||
|
||||
if (p[3])
|
||||
{
|
||||
|
@ -13528,6 +13543,25 @@ unsigned gpioHardwareRevision(void)
|
|||
pi_dram_bus = 0xC0000000;
|
||||
pi_mem_flag = 0x04;
|
||||
}
|
||||
else if (!strncmp("Raspberry Pi 4 Model B", buf, 22))
|
||||
{
|
||||
pi_ispi = 1;
|
||||
piCores = 4;
|
||||
pi_peri_phys = 0xFE000000;
|
||||
pi_dram_bus = 0xC0000000;
|
||||
pi_mem_flag = 0x04;
|
||||
pi_is_2711 = 1;
|
||||
clk_osc_freq = CLK_OSC_FREQ_2711;
|
||||
clk_plld_freq = CLK_PLLD_FREQ_2711;
|
||||
hw_pwm_max_freq = PI_HW_PWM_MAX_FREQ_2711;
|
||||
hw_clk_min_freq = PI_HW_CLK_MIN_FREQ_2711;
|
||||
hw_clk_max_freq = PI_HW_CLK_MAX_FREQ_2711;
|
||||
if (!gpioMaskSet)
|
||||
{
|
||||
gpioMaskSet = 1;
|
||||
gpioMask = PI_DEFAULT_UPDATE_MASK_PI4B;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(filp);
|
||||
|
|
Loading…
Reference in New Issue