imagecapture: implement to review suggestions · csamuelson/circuitpython@99799cd · GitHub
Skip to content

Commit 99799cd

Browse files
committed
imagecapture: implement to review suggestions
1 parent 76d68f2 commit 99799cd

3 files changed

Lines changed: 26 additions & 27 deletions

File tree

locale/circuitpython.pot

Lines changed: 5 additions & 5 deletions

ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle
4949
const mcu_pin_obj_t *data0,
5050
const mcu_pin_obj_t *data_clock,
5151
const mcu_pin_obj_t *vertical_sync,
52-
const mcu_pin_obj_t *horizontal_sync,
52+
const mcu_pin_obj_t *horizontal_reference,
5353
int data_count)
5454
{
5555
if (data0->number != PIN_PCC_D0) {
@@ -63,16 +63,16 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle
6363
if (vertical_sync && vertical_sync->number != PIN_PCC_DEN1) {
6464
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_vsync);
6565
}
66-
if (horizontal_sync && horizontal_sync->number != PIN_PCC_DEN2) {
67-
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_hsync);
66+
if (horizontal_reference && horizontal_reference->number != PIN_PCC_DEN2) {
67+
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_href);
6868
}
6969
if (data_clock->number != PIN_PCC_CLK) {
7070
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data_clock);
7171
}
7272
// technically, 0 was validated as free already but check again
7373
for (int i=0; i<data_count; i++) {
7474
if (!pin_number_is_free(data0->number + i)) {
75-
mp_raise_ValueError_varg(translate("PCC_D%d in use"), i);
75+
mp_raise_ValueError_varg(translate("data pin #%d in use"), i);
7676
}
7777
}
7878

@@ -92,7 +92,7 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle
9292
// Now we know we can allocate all pins
9393
self->data_count = data_count;
9494
self->vertical_sync = vertical_sync ? vertical_sync->number : NO_PIN;
95-
self->horizontal_sync = horizontal_sync ? vertical_sync->number : NO_PIN;
95+
self->horizontal_reference = horizontal_reference ? vertical_sync->number : NO_PIN;
9696
gpio_set_pin_direction(PIN_PCC_CLK, GPIO_DIRECTION_IN);
9797
gpio_set_pin_pull_mode(PIN_PCC_CLK, GPIO_PULL_OFF);
9898
gpio_set_pin_function(PIN_PCC_CLK, GPIO_PIN_FUNCTION_PCC);
@@ -103,7 +103,7 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle
103103
gpio_set_pin_function(PIN_PCC_DEN1, GPIO_PIN_FUNCTION_PCC); // VSYNC
104104
//claim_pin_number(PIN_PCC_DEN1);
105105
}
106-
if (horizontal_sync) {
106+
if (horizontal_reference) {
107107
gpio_set_pin_direction(PIN_PCC_DEN2, GPIO_DIRECTION_IN);
108108
gpio_set_pin_pull_mode(PIN_PCC_DEN2, GPIO_PULL_OFF);
109109
gpio_set_pin_function(PIN_PCC_DEN2, GPIO_PIN_FUNCTION_PCC); // HSYNC
@@ -123,7 +123,7 @@ void common_hal_imagecapture_parallelimagecapture_deinit(imagecapture_parallelim
123123
return;
124124
}
125125
reset_pin_number(self->vertical_sync);
126-
reset_pin_number(self->horizontal_sync);
126+
reset_pin_number(self->horizontal_reference);
127127
reset_pin_number(PIN_PCC_CLK);
128128
for (int i=0; i<self->data_count; i++) {
129129
reset_pin_number(PIN_PCC_D0 + i);

shared-bindings/imagecapture/ParallelImageCapture.c

Lines changed: 14 additions & 15 deletions

0 commit comments

Comments
 (0)