| 355 | } |
| 356 | |
| 357 | void xs_SSD1306_send(xsMachine *the) |
| 358 | { |
| 359 | ssd1606 ssd = xsmcGetHostData(xsThis); |
| 360 | int argc = xsmcArgc; |
| 361 | const uint8_t *data; |
| 362 | xsUnsignedValue count; |
| 363 | |
| 364 | xsmcGetBufferReadable(xsArg(0), (void **)&data, &count); |
| 365 | |
| 366 | if (argc > 1) { |
| 367 | xsIntegerValue offset = xsmcToInteger(xsArg(1)); |
| 368 | |
| 369 | if ((xsUnsignedValue)offset >= count) |
| 370 | xsUnknownError("bad offset"); |
| 371 | data += offset; |
| 372 | count -= offset; |
| 373 | if (argc > 2) { |
| 374 | xsIntegerValue c = xsmcToInteger(xsArg(2)); |
| 375 | if (c > count) |
| 376 | xsUnknownError("bad count"); |
| 377 | count = c; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | ssd1306Send((PocoPixel *)data, count, ssd); |
| 382 | } |
| 383 | |
| 384 | void xs_SSD1306_end(xsMachine *the) |
| 385 | { |
nothing calls this directly
no test coverage detected