drivers/sensors: Update BOSON to using post_process callback.

This commit is contained in:
Kwabena W. Agyeman 2025-08-14 14:48:54 -07:00
parent 5d046e2c92
commit ae8eae9290

View File

@ -138,13 +138,7 @@ static int set_colorbar(omv_csi_t *csi, int enable) {
return 0; return 0;
} }
static int snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) { static int post_process(omv_csi_t *csi, image_t *image, uint32_t flags) {
int ret = ((omv_csi_snapshot_t) csi->priv)(csi, image, flags);
if (ret < 0) {
return ret;
}
int num_pixels = csi->resolution[boson_framesize][0] * csi->resolution[boson_framesize][1]; int num_pixels = csi->resolution[boson_framesize][0] * csi->resolution[boson_framesize][1];
if (csi->color_palette && (framebuffer_get_buffer_size(csi->fb) >= (num_pixels * sizeof(uint16_t)))) { if (csi->color_palette && (framebuffer_get_buffer_size(csi->fb) >= (num_pixels * sizeof(uint16_t)))) {
@ -156,7 +150,7 @@ static int snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) {
csi->fb->pixfmt = PIXFORMAT_RGB565; csi->fb->pixfmt = PIXFORMAT_RGB565;
} }
return ret; return 0;
} }
int boson_init(omv_csi_t *csi) { int boson_init(omv_csi_t *csi) {
@ -165,8 +159,7 @@ int boson_init(omv_csi_t *csi) {
csi->set_pixformat = set_pixformat; csi->set_pixformat = set_pixformat;
csi->set_framesize = set_framesize; csi->set_framesize = set_framesize;
csi->set_colorbar = set_colorbar; csi->set_colorbar = set_colorbar;
csi->priv = csi->snapshot; csi->post_process = post_process;
csi->snapshot = snapshot;
// Set csi flags // Set csi flags
csi->vsync_pol = 0; csi->vsync_pol = 0;