AP_RAMTRON: reduce scope for WITH_SEMAPHORE

This commit is contained in:
Peter Barker 2022-07-16 15:03:51 +10:00 committed by Peter Barker
parent 2c64922a14
commit d593727205
1 changed files with 5 additions and 3 deletions

View File

@ -49,7 +49,6 @@ bool AP_RAMTRON::init(void)
DEV_PRINTF("No RAMTRON device\n");
return false;
}
WITH_SEMAPHORE(dev->get_semaphore());
struct cypress_rdid {
uint8_t manufacturer[6];
@ -65,9 +64,12 @@ bool AP_RAMTRON::init(void)
uint8_t rdid[sizeof(cypress_rdid)];
{
WITH_SEMAPHORE(dev->get_semaphore());
if (!dev->read_registers(RAMTRON_RDID, rdid, sizeof(rdid))) {
return false;
}
}
for (uint8_t i = 0; i < ARRAY_SIZE(ramtron_ids); i++) {
if (ramtron_ids[i].rdid_type == RDID_type::Cypress) {