Skip to content

A while-statement should not be used for a delay. #2

@Koepel

Description

@Koepel

In the file "NHD-3.12-25664UC.ino" in the functions "data()" and "command()" there is a while-statement that seems to be used as a delay:

while(0);

That is not a safe delay. The compiler might even remove it.
The 'nop' instruction is used for very short delays. There is a function to insert 'nop' instructions: __builtin_avr_delay_cycles(delay)
The compiler might insert other instructions instead of 'nop', but it will delay the number of clock cycles that is in the parameter.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions