Work around paper feed issues
This commit is contained in:
parent
79ccdda9e3
commit
94b7ac4f8f
|
@ -1 +1 @@
|
||||||
473
|
484
|
||||||
|
|
|
@ -42,8 +42,7 @@ static void InitStepper(void)
|
||||||
| (0x01 << (4 * PIN_STEPPER_BP - 32)) // Output, max. 10 MHz
|
| (0x01 << (4 * PIN_STEPPER_BP - 32)) // Output, max. 10 MHz
|
||||||
;
|
;
|
||||||
|
|
||||||
// The SysTick is clocked by AHB / 8
|
SysTick_Config(48000000 / LTP1245_MAX_DRIVE_FREQ - 1);
|
||||||
SysTick_Config(48000000 / 8 / LTP1245_MAX_DRIVE_FREQ - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitSensors(void)
|
static void InitSensors(void)
|
||||||
|
@ -385,6 +384,8 @@ void SysTick_Handler(void)
|
||||||
const int GPIO_MASK = ((1 << PIN_STEPPER_AM) | (1 << PIN_STEPPER_AP)
|
const int GPIO_MASK = ((1 << PIN_STEPPER_AM) | (1 << PIN_STEPPER_AP)
|
||||||
| (1 << PIN_STEPPER_BM) | (1 << PIN_STEPPER_BP));
|
| (1 << PIN_STEPPER_BM) | (1 << PIN_STEPPER_BP));
|
||||||
|
|
||||||
|
GPIOC->BRR = (1 << PIN_LED);
|
||||||
|
|
||||||
if(Stepper_Delta != 0)
|
if(Stepper_Delta != 0)
|
||||||
{
|
{
|
||||||
off = false;
|
off = false;
|
||||||
|
@ -420,6 +421,8 @@ void SysTick_Handler(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
AdvanceStateMachine();
|
AdvanceStateMachine();
|
||||||
|
|
||||||
|
GPIOC->BSRR = (1 << PIN_LED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADC1_2_IRQHandler(void)
|
void ADC1_2_IRQHandler(void)
|
||||||
|
|
13
src/main.c
13
src/main.c
|
@ -12,15 +12,8 @@ int main(void)
|
||||||
Camera_Init();
|
Camera_Init();
|
||||||
LTP1245_Init();
|
LTP1245_Init();
|
||||||
|
|
||||||
|
LTP1245_FeedPaper(100);
|
||||||
char buff[30] = "Build No. ";
|
|
||||||
itoa(BUILD_NUMBER, buff + strlen(buff), 10);
|
|
||||||
Print_Text(buff, &Messe_Duesseldorf_39);
|
|
||||||
|
|
||||||
LTP1245_FeedPaper(2);
|
|
||||||
|
|
||||||
LTP1245_FeedPaper(10);
|
LTP1245_FeedPaper(10);
|
||||||
// LTP1245_FeedPaper(10);
|
|
||||||
// LTP1245_Cut();
|
// LTP1245_Cut();
|
||||||
|
|
||||||
while(!Camera_Captured);
|
while(!Camera_Captured);
|
||||||
|
@ -28,8 +21,12 @@ int main(void)
|
||||||
extern uint8_t ImageBuffer[CAMERA_IMAGE_WIDTH * CAMERA_IMAGE_HEIGHT / 8];
|
extern uint8_t ImageBuffer[CAMERA_IMAGE_WIDTH * CAMERA_IMAGE_HEIGHT / 8];
|
||||||
Print_Image(ImageBuffer, CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_HEIGHT, 2);
|
Print_Image(ImageBuffer, CAMERA_IMAGE_WIDTH, CAMERA_IMAGE_HEIGHT, 2);
|
||||||
|
|
||||||
|
LTP1245_FeedPaper(100);
|
||||||
|
LTP1245_FeedPaper(10);
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
__WFI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
src/ov7670.c
10
src/ov7670.c
|
@ -313,6 +313,9 @@ void TIM1_CC_IRQHandler(void)
|
||||||
if(FrameCount == 10)
|
if(FrameCount == 10)
|
||||||
{
|
{
|
||||||
Camera_Captured = 1;
|
Camera_Captured = 1;
|
||||||
|
// Disable everything
|
||||||
|
TIM3->CR1 = 0;
|
||||||
|
TIM1->CR1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dummy read
|
// Dummy read
|
||||||
|
@ -326,8 +329,6 @@ void TIM3_IRQHandler(void)
|
||||||
{
|
{
|
||||||
// HSYNC
|
// HSYNC
|
||||||
|
|
||||||
GPIOC->BRR = (1 << PIN_LED);
|
|
||||||
|
|
||||||
TIM3->DIER &= ~TIM_DIER_CC1DE;
|
TIM3->DIER &= ~TIM_DIER_CC1DE;
|
||||||
TIM3->SR &= ~TIM_SR_CC1IF;
|
TIM3->SR &= ~TIM_SR_CC1IF;
|
||||||
|
|
||||||
|
@ -337,7 +338,8 @@ void TIM3_IRQHandler(void)
|
||||||
DMA1_Channel6->CCR = DMA_CCR_PL | DMA_CCR_MINC | DMA_CCR_EN;
|
DMA1_Channel6->CCR = DMA_CCR_PL | DMA_CCR_MINC | DMA_CCR_EN;
|
||||||
TIM3->DIER |= TIM_DIER_CC1DE;
|
TIM3->DIER |= TIM_DIER_CC1DE;
|
||||||
|
|
||||||
if(!Camera_Captured && (~CurrentLine & 1))
|
if(!Camera_Captured && (~CurrentLine & 1)
|
||||||
|
&& (CurrentLine / 2 < CAMERA_IMAGE_HEIGHT))
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
for(int i = 0; i < CAMERA_IMAGE_WIDTH; i++)
|
for(int i = 0; i < CAMERA_IMAGE_WIDTH; i++)
|
||||||
|
@ -364,6 +366,4 @@ void TIM3_IRQHandler(void)
|
||||||
// Dummy read
|
// Dummy read
|
||||||
TIM3->CCR2;
|
TIM3->CCR2;
|
||||||
TIM3->SR &= ~TIM_SR_CC2IF;
|
TIM3->SR &= ~TIM_SR_CC2IF;
|
||||||
|
|
||||||
GPIOC->BSRR = (1 << PIN_LED);
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue