[peripherals] fixed a ambiguous variable and replaced .size() by .empty()
Merge pull request #3784 from wsoltys/peripherals

[peripherals] fixed a ambiguous variable and replaced .size() by .empty()