Commit 22d0cb6c authored by kamako's avatar kamako
Browse files

Update printing.h

parent 5010fa26
......@@ -7,7 +7,7 @@
#ifndef PRINTING_H_
#define PRINTING_H_
#include "drivers/mss_ace/mss_ace.h"
#define E_STEPS_PER_MM 837
......@@ -15,7 +15,7 @@ volatile uint32_t* EX_Base = (uint32_t*) 0x40050100; // EXTRUDER
volatile uint32_t* HE_Base = (uint32_t*) 0x40050200; // HOTEND
volatile uint32_t* test = (uint32_t*) 0x40050208;
ace_channel_handle_t adc_handler;
typedef enum
{
PERIOD = 0x00,
......@@ -51,7 +51,7 @@ void init_print()
// HOTEND
*(uint32_t*)((uint32_t)HE_Base + AUTO) = 0;
*(uint32_t*)((uint32_t)HE_Base + SCALED_SP) = 0;
*(uint32_t*)((uint32_t)HE_Base + SCALED_SP) = 0;
*(uint32_t*)((uint32_t)HE_Base + SW) = 0;
*(uint32_t*)((uint32_t)HE_Base + FAN) = 0;
*(uint32_t*)((uint32_t)HE_Base + PID_KP) = 0;
......@@ -59,8 +59,15 @@ void init_print()
*(uint32_t*)((uint32_t)HE_Base + PID_KD) = 0;
*(uint32_t*)((uint32_t)HE_Base + SENSITIVITY) = 10;
// *(&ACE->PPE_FLAGS0_IRQ_EN) = 0xFFFFFFFF; // Thermistor THRESH_FLAGS enable
// *(&ACE->FPGA_FLAGS_SEL) = 0xFFFFFF00;
*(&ACE->PPE_FLAGS0_IRQ_EN) = 0xFFFFFFFF; // Thermistor THRESH_FLAGS enable
*(&ACE->FPGA_FLAGS_SEL) = 0xFFFFFFFF;
ACE_init();
adc_handler = ACE_get_channel_handle((const uint8_t *)"ADCDirectInput_5");
adc_handler = ACE_get_channel_handle((const uint8_t *)"ADCDirectInput_5");
}
void extrude(int mm)
......@@ -116,11 +123,6 @@ void set_hotend_pid_sensitivity( uint32_t val)
*(uint32_t*)((uint32_t)HE_Base + SENSITIVITY) = val;
}
void set_raw_thermistor( uint32_t val )
{
*(uint32_t*)((uint32_t)HE_Base + THERMISTOR) = val;
}
/*** GETTERS ***/
uint32_t get_extruder_period( void )
{
......@@ -173,7 +175,8 @@ uint32_t get_hotend_pid_sensitivity( void )
uint32_t get_raw_thermistor( void )
{
return *(uint32_t*)((uint32_t)HE_Base + THERMISTOR);
return ACE_get_ppe_sample(adc_handler);
//return *(uint32_t*)((uint32_t)HE_Base + THERMISTOR);
}
uint32_t get_pid_sp( void )
......@@ -191,3 +194,4 @@ void debug_print( void )
}
#endif /* PRINTING_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment