Enable output enable relay
This commit is contained in:
parent
a900c9481d
commit
6f6c9df74f
2 changed files with 12 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
325
|
||||
327
|
||||
|
|
|
|||
|
|
@ -3,11 +3,13 @@
|
|||
#include "pwm_output.h"
|
||||
#include "config.h"
|
||||
#include "pinning.h"
|
||||
#include "led.h"
|
||||
#include "ownership.h"
|
||||
|
||||
MODULE_OWNS_PIN(GPIOA, PIN_OUTPUT_X);
|
||||
MODULE_OWNS_PIN(GPIOA, PIN_OUTPUT_Y);
|
||||
MODULE_OWNS_PIN(GPIOB, PIN_PEN_STATE);
|
||||
MODULE_OWNS_PIN(GPIOA, PIN_OUTPUT_ENABLE);
|
||||
MODULE_OWNS_PERIPHERAL(TIM1);
|
||||
MODULE_OWNS_PERIPHERAL(TIM4);
|
||||
|
||||
|
|
@ -96,8 +98,10 @@ static unsigned int Output_ApproximateLength(int dx, int dy)
|
|||
|
||||
static bool Output_FetchNextPoint(void)
|
||||
{
|
||||
LED_Off(LED_Pink);
|
||||
if(Output_BufferRead == Output_BufferWrite)
|
||||
{
|
||||
LED_Off(LED_Orange);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -227,6 +231,13 @@ void Output_Init(void)
|
|||
|
||||
Output_PenUp();
|
||||
|
||||
GPIOA->CRL = (GPIOA->CRL
|
||||
& ~(0xf << (4 * PIN_OUTPUT_ENABLE)))
|
||||
| (0x02 << (PIN_OUTPUT_ENABLE * 4)) // 2 MHz push-pull output
|
||||
;
|
||||
// Close relays
|
||||
GPIOA->BSRR = (1 << PIN_OUTPUT_ENABLE);
|
||||
|
||||
GPIOA->CRH = (GPIOA->CRH
|
||||
& ~(0xf << (4 * PIN_OUTPUT_X - 32))
|
||||
& ~(0xf << (4 * PIN_OUTPUT_Y - 32)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue