Compare commits
No commits in common. "323fa682227c9b283a80a33668a55283875e36f4" and "b2502e7f0a20793971972cdec319bf185ce4f299" have entirely different histories.
323fa68222
...
b2502e7f0a
@ -2,7 +2,7 @@
|
||||
<BaliProject version="3.2" title="lmg6202" device="LCMXO2-1200HC-5SG32C" default_implementation="impl1">
|
||||
<Options/>
|
||||
<Implementation title="impl1" dir="impl1" description="impl1" synthesis="synplify" default_strategy="Strategy1">
|
||||
<Options def_top="design.top" lib="design" top="design.top"/>
|
||||
<Options def_top="design.top" top="design.top"/>
|
||||
<Source name="../ip/gram0/gram0.ipx" type="IPX_Module" type_short="IPX">
|
||||
<Options/>
|
||||
</Source>
|
||||
@ -18,12 +18,6 @@
|
||||
<Source name="../design/spi_if.vhd" type="VHDL" type_short="VHDL">
|
||||
<Options lib="design"/>
|
||||
</Source>
|
||||
<Source name="../ip/pll0/pll0.vhd" type="VHDL" type_short="VHDL">
|
||||
<Options lib="ip"/>
|
||||
</Source>
|
||||
<Source name="../generics/synchronizer.vhd" type="VHDL" type_short="VHDL">
|
||||
<Options lib="generics"/>
|
||||
</Source>
|
||||
<Source name="impl1/impl1.xcf" type="Programming Project File" type_short="Programming">
|
||||
<Options/>
|
||||
</Source>
|
||||
|
@ -190,7 +190,7 @@
|
||||
<Property name="PROP_SYN_ResolvedMixedDrivers" value="False" time="0"/>
|
||||
<Property name="PROP_SYN_UpdateCompilePtTimData" value="False" time="0"/>
|
||||
<Property name="PROP_SYN_UseLPF" value="True" time="0"/>
|
||||
<Property name="PROP_SYN_VHDL2008" value="True" time="0"/>
|
||||
<Property name="PROP_SYN_VHDL2008" value="False" time="0"/>
|
||||
<Property name="PROP_THERMAL_DefaultFreq" value="0" time="0"/>
|
||||
<Property name="PROP_TIM_MaxDelSimDes" value="" time="0"/>
|
||||
<Property name="PROP_TIM_MinSpeedGrade" value="False" time="0"/>
|
||||
|
Binary file not shown.
@ -292,9 +292,8 @@ static int lw35ioc_chardev_open(struct inode *inodep, struct file *filep) {
|
||||
break;
|
||||
case PASSIVE:
|
||||
lw35ioc_reset_ioc_hw(serdev);
|
||||
usleep_range(2100000, 2210000);
|
||||
usleep_range(1000000, 1010000);
|
||||
dev_info(&serdev->dev, "Put ioc into active mode.\n");
|
||||
serdev_device_write(serdev, "\xFF", 1, 0);
|
||||
priv->state = ACTIVE;
|
||||
break;
|
||||
case ACTIVE:
|
||||
|
@ -112,7 +112,7 @@ void hardfault() {
|
||||
#define PRINTER_CONTROL_CHAR 56
|
||||
#define PRINTER_NO_CHAR 128
|
||||
|
||||
#define ASCII_TRANSLATION_TABLE_SIZE (128 + 12)
|
||||
#define ASCII_TRANSLATION_TABLE_SIZE 128 + 12
|
||||
const uint8_t ascii_translation_table[ASCII_TRANSLATION_TABLE_SIZE] PROGMEM = {
|
||||
PRINTER_CONTROL_CHAR,
|
||||
PRINTER_CONTROL_CHAR,
|
||||
@ -277,9 +277,6 @@ const uint8_t ascii_translation_table[ASCII_TRANSLATION_TABLE_SIZE] PROGMEM = {
|
||||
#define PIN_CORRECTION (1 << 1)
|
||||
#define PIN_ARMHAMMER (1 << 0)
|
||||
|
||||
/* Misc I/O */
|
||||
#define MISCIO(t) t##D
|
||||
#define PIN_BACKLIGHT (1 << 2)
|
||||
|
||||
/* Stepper drive */
|
||||
|
||||
@ -674,22 +671,11 @@ void move_carriage_to_far_left(uint8_t reset)
|
||||
|
||||
if (LIMITSWITCH) {
|
||||
debug_write("[car] Clearing switch area...\r\n");
|
||||
cnt = 32;
|
||||
while (LIMITSWITCH && (cnt> 0)) {
|
||||
while (LIMITSWITCH) {
|
||||
if (block_for(TIM_CARRIAGE, STEPPER_CFG_CARRIAGE.delay)) {
|
||||
STEPPER_NEXT(CARRIAGE, 1);
|
||||
cnt--;
|
||||
}
|
||||
}
|
||||
if (LIMITSWITCH && !cnt) { // We're probably in correction mode
|
||||
DCMOTOR_EN;
|
||||
arm_correction();
|
||||
_delay_ms(1000);
|
||||
DCMOTOR_STOP;
|
||||
}
|
||||
if (LIMITSWITCH) { // If the switch is still not released, there's some problem we can't fix from SW
|
||||
hardfault();
|
||||
}
|
||||
for (cnt = 0; cnt < 16; cnt++) {
|
||||
STEPPER_NEXT(CARRIAGE, 1);
|
||||
}
|
||||
@ -925,7 +911,7 @@ void printer_process()
|
||||
|
||||
switch (state) {
|
||||
case IDLE:
|
||||
if (print_buffer_rd != print_buffer_wr) { // TODO: maybe add "|| current_is_linebreak"
|
||||
if (print_buffer_rd != print_buffer_wr) { // maybe add "|| current_is_linebreak"
|
||||
if (!DCMOTOR_ISACTIVE) {
|
||||
DCMOTOR_EN;
|
||||
_delay_ms(100); /* Let the motor get up to speed */
|
||||
@ -1033,8 +1019,7 @@ void printer_process()
|
||||
// stepper_status_WHEEL.target_pos += 10;
|
||||
// // -----------
|
||||
|
||||
if (stepper_status_CARRIAGE.target_pos > PRINTER_STOP_RIGHT ||
|
||||
stepper_status_CARRIAGE.target_pos < 0) { // Margin safety
|
||||
if (stepper_status_CARRIAGE.target_pos > PRINTER_STOP_RIGHT) { // Right margin safety
|
||||
hardfault();
|
||||
}
|
||||
stepper_perform_movement(&stepper_status_LINEFEED, &STEPPER_CFG_LINEFEED);
|
||||
@ -1226,10 +1211,10 @@ static void system_test_auto()
|
||||
if (POSITION_REACHED(WHEEL) && POSITION_REACHED(CARRIAGE) && POSITION_REACHED(LINEFEED) && print_stat) {
|
||||
print_stat = 0;
|
||||
debug_printf("[pos] %uL %uC%c %uW\r\n",
|
||||
stepper_status_LINEFEED.pos,
|
||||
stepper_status_CARRIAGE.pos,
|
||||
(LIMITSWITCH ? '*' : '+'),
|
||||
stepper_status_WHEEL.pos);
|
||||
stepper_status_LINEFEED.pos,
|
||||
stepper_status_CARRIAGE.pos,
|
||||
(LIMITSWITCH ? '*' : '+'),
|
||||
stepper_status_WHEEL.pos);
|
||||
}
|
||||
|
||||
if (do_it) {
|
||||
@ -1289,10 +1274,6 @@ int main()
|
||||
STEPPER_SET_IO(WHEEL);
|
||||
STEPPER_SET_IO(LINEFEED);
|
||||
|
||||
/* Set up miscellaneous I/O */
|
||||
MISCIO(DDR) |= PIN_BACKLIGHT;
|
||||
MISCIO(PORT) |= PIN_BACKLIGHT; /* Permanently enable backlight */
|
||||
|
||||
/* Set up SysTick Timer */
|
||||
TCCR1B = (1 << WGM12) | (1 << CS11); // f_tim = 8 MHz / 8
|
||||
OCR1A = 2000 / TIMESCALE;
|
||||
@ -1302,11 +1283,6 @@ int main()
|
||||
sync_uart();
|
||||
update_status(0);
|
||||
debug_write("\n\n\r[sys] STARTING IO CONTROLLER...\r\n");
|
||||
#ifndef DEBUG_BUILD
|
||||
while (!((UCSRA & (1 << RXC)) && (UDR == 0xFF))); /* Wait for init command from driver */
|
||||
update_status(0);
|
||||
_delay_ms(250);
|
||||
#endif
|
||||
debug_write("[sys] Enabling interrupts.\r\n");
|
||||
sei();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user