| 26 | // properly. |
| 27 | namespace fl { |
| 28 | fl::u16 XY(fl::u16 x, fl::u16 y) { |
| 29 | if (x >= WIDTH || y >= HEIGHT) |
| 30 | return 0; |
| 31 | if (kMatrixSerpentineLayout) { |
| 32 | if (y & 1) { |
| 33 | // odd rows run right-to-left |
| 34 | return y * WIDTH + (WIDTH - 1 - x); |
| 35 | } else { |
| 36 | // even rows run left-to-right |
| 37 | return y * WIDTH + x; |
| 38 | } |
| 39 | } else { |
| 40 | return y * WIDTH + x; |
| 41 | } |
| 42 | } |
| 43 | } // namespace fl |
| 44 | |
| 45 | // ===== particle sim (Processing port) ===== |
no outgoing calls
no test coverage detected