├── source
├── board
│ ├── Ascii16_code.h
│ ├── bsp_flash.cpp
│ ├── bsp_init.cpp
│ ├── bsp_spi_tft.h
│ ├── bsp_timer.cpp
│ ├── bsp_spi_tft.cpp
│ ├── bsp_flash.h
│ ├── bsp_ots.h
│ ├── bsp_wdt.h
│ ├── bsp_rmu.h
│ ├── bsp_rmu.cpp
│ ├── bsp_wdt.cpp
│ ├── bsp_ots.cpp
│ ├── bsp_sdio.h
│ ├── bsp_timer.h
│ └── bsp_adc.h
├── Marlin
│ ├── src
│ │ ├── lcd
│ │ │ ├── 文件夹里面的我都换了就是外面这几个没换不知道行不行.txt
│ │ │ ├── marlinui.cpp
│ │ │ ├── menu
│ │ │ │ ├── menu_main.cpp
│ │ │ │ ├── menu_tune.cpp
│ │ │ │ ├── menu_motion.cpp
│ │ │ │ ├── menu_configuration.cpp
│ │ │ │ ├── menu_mmu2.h
│ │ │ │ ├── menu_touch_screen.cpp
│ │ │ │ ├── menu_addon.h
│ │ │ │ └── menu_game.cpp
│ │ │ ├── tft
│ │ │ │ ├── tft_string.cpp
│ │ │ │ ├── fontdata
│ │ │ │ │ ├── profont_22.cpp
│ │ │ │ │ └── helvetica_14.cpp
│ │ │ │ ├── tft.cpp
│ │ │ │ ├── ui_320x240.h
│ │ │ │ ├── ui_1024x600.h
│ │ │ │ ├── images
│ │ │ │ │ └── slider_8x16x4.cpp
│ │ │ │ └── ui_480x320.h
│ │ │ ├── extui
│ │ │ │ ├── AC_spi_dgus.h
│ │ │ │ └── AC_spi_dgus.cpp
│ │ │ ├── tft_io
│ │ │ │ └── tft_ids.h
│ │ │ ├── language
│ │ │ │ └── language_el_CY.h
│ │ │ ├── scaled_tft.h
│ │ │ └── fontutils.h
│ │ ├── MarlinCore.cpp
│ │ ├── HAL
│ │ │ ├── STM32
│ │ │ │ ├── sdio.cpp
│ │ │ │ ├── inc
│ │ │ │ │ ├── Conditionals_LCD.h
│ │ │ │ │ ├── Conditionals_adv.h
│ │ │ │ │ └── Conditionals_post.h
│ │ │ │ ├── fastio.cpp
│ │ │ │ ├── spi_pins.h
│ │ │ │ ├── timers.cpp
│ │ │ │ ├── watchdog.h
│ │ │ │ └── endstop_interrupts.h
│ │ │ ├── shared
│ │ │ │ ├── esp_wifi.h
│ │ │ │ ├── math_32bit.h
│ │ │ │ ├── eeprom_api.cpp
│ │ │ │ ├── HAL_ST7920.h
│ │ │ │ └── esp_wifi.cpp
│ │ │ └── HAL.h
│ │ ├── libs
│ │ │ ├── crc16.h
│ │ │ ├── dtostrf.h
│ │ │ ├── crc16.cpp
│ │ │ └── hex_print.h
│ │ ├── gcode
│ │ │ ├── control
│ │ │ │ ├── M400.cpp
│ │ │ │ ├── M997.cpp
│ │ │ │ ├── M85.cpp
│ │ │ │ ├── M120_M121.cpp
│ │ │ │ ├── M999.cpp
│ │ │ │ ├── M211.cpp
│ │ │ │ ├── M108_M112_M410.cpp
│ │ │ │ └── M280.cpp
│ │ │ ├── host
│ │ │ │ ├── M119.cpp
│ │ │ │ ├── M110.cpp
│ │ │ │ ├── M16.cpp
│ │ │ │ ├── M876.cpp
│ │ │ │ └── M113.cpp
│ │ │ ├── units
│ │ │ │ ├── M82_M83.cpp
│ │ │ │ ├── G20_G21.cpp
│ │ │ │ └── M149.cpp
│ │ │ ├── lcd
│ │ │ │ ├── M117.cpp
│ │ │ │ ├── M250.cpp
│ │ │ │ ├── M300.cpp
│ │ │ │ ├── M995.cpp
│ │ │ │ └── M73.cpp
│ │ │ ├── motion
│ │ │ │ ├── G80.cpp
│ │ │ │ └── G4.cpp
│ │ │ ├── sd
│ │ │ │ ├── M928.cpp
│ │ │ │ ├── M26.cpp
│ │ │ │ ├── M30.cpp
│ │ │ │ ├── M21_M22.cpp
│ │ │ │ ├── M524.cpp
│ │ │ │ ├── M20.cpp
│ │ │ │ ├── M34.cpp
│ │ │ │ ├── M23.cpp
│ │ │ │ ├── M33.cpp
│ │ │ │ ├── M27.cpp
│ │ │ │ └── M808.cpp
│ │ │ ├── probe
│ │ │ │ ├── G31_G32.cpp
│ │ │ │ └── M401_M402.cpp
│ │ │ ├── calibrate
│ │ │ │ └── M12.cpp
│ │ │ ├── config
│ │ │ │ ├── M540.cpp
│ │ │ │ └── M221.cpp
│ │ │ ├── temp
│ │ │ │ ├── M155.cpp
│ │ │ │ └── M105.cpp
│ │ │ ├── stats
│ │ │ │ └── M31.cpp
│ │ │ └── feature
│ │ │ │ └── pause
│ │ │ │ └── G27.cpp
│ │ ├── core
│ │ │ ├── millis_t.h
│ │ │ └── debug_section.h
│ │ ├── module
│ │ │ ├── thermistor
│ │ │ │ ├── thermistor_998.h
│ │ │ │ ├── thermistor_999.h
│ │ │ │ ├── thermistor_110.h
│ │ │ │ ├── thermistor_147.h
│ │ │ │ ├── thermistor_1010.h
│ │ │ │ ├── thermistor_1047.h
│ │ │ │ ├── thermistor_8.h
│ │ │ │ ├── thermistor_4.h
│ │ │ │ ├── thermistor_70.h
│ │ │ │ ├── thermistor_13.h
│ │ │ │ ├── thermistor_332.h
│ │ │ │ ├── thermistor_202.h
│ │ │ │ └── thermistor_3.h
│ │ │ └── stepper
│ │ │ │ └── indirection.cpp
│ │ ├── sd
│ │ │ ├── SdFatUtil.h
│ │ │ ├── Sd2Card_sdio.h
│ │ │ ├── SdFile.h
│ │ │ └── SdFatUtil.cpp
│ │ ├── feature
│ │ │ ├── z_stepper_align.h
│ │ │ ├── e_parser.cpp
│ │ │ └── caselight.h
│ │ └── inc
│ │ │ └── MarlinConfig.h
│ └── Version.h
├── app
│ ├── app_uart.cpp
│ ├── app_uart.h
│ └── app_sserial_test.cpp
├── framework
│ ├── cores
│ │ ├── pins_arduino.h
│ │ ├── Arduino.cpp
│ │ ├── iwdg.cpp
│ │ ├── wirish_time.h
│ │ ├── itoa.h
│ │ ├── io.h
│ │ ├── io.cpp
│ │ ├── Server.h
│ │ ├── libmaple_types.h
│ │ ├── flash.h
│ │ ├── Tone.cpp
│ │ ├── Tone.h
│ │ ├── bits.h
│ │ ├── Arduino.h
│ │ ├── Client.h
│ │ ├── wirish_math.h
│ │ ├── pgmspace.h
│ │ ├── libmaple.h
│ │ └── spi_private.h
│ └── TMCStepper
│ │ ├── source
│ │ ├── GCONF.cpp
│ │ ├── TMC_MACROS.h
│ │ ├── SERIAL_SWITCH.h
│ │ ├── SERIAL_SWITCH.cpp
│ │ ├── SW_SPI.h
│ │ ├── SGCSCONF.cpp
│ │ ├── IHOLD_IRUN.cpp
│ │ ├── SHORT_CONF.cpp
│ │ ├── SMARTEN.cpp
│ │ ├── DRV_CONF.cpp
│ │ ├── RAMP_STAT.cpp
│ │ ├── TMC2209_bitfields.h
│ │ ├── TMC2160_bitfields.h
│ │ ├── TMC5160_bitfields.h
│ │ └── DRVCONF.cpp
│ │ └── TMCStepper_UTILITY.h
├── drivers
│ ├── library
│ │ └── inc
│ │ │ └── hc32f46x_dcu.h
│ └── board
│ │ ├── board_cfg.h
│ │ ├── startup.cpp
│ │ ├── board_adc.cpp
│ │ ├── board_sdio.cpp
│ │ ├── board_sdio.h
│ │ └── board_adc.h
├── compoment
│ └── sdio
│ │ ├── sd_card
│ │ └── inc
│ │ │ └── sdmmc_cmd.h
│ │ └── sdio_hal.h
└── arduino
│ └── Printable.h
├── indexed-image-array
├── .gitignore
├── input.png
├── indexed-image-array.exe
├── Cargo.toml
└── src
│ └── main.rs
├── workspace
├── bin_expand.exe
├── Flash_HC32F46x.FLM
└── RTE
│ └── _firmware_Release
│ └── RTE_Components.h
├── .idea
├── vcs.xml
├── misc.xml
├── .gitignore
├── modules.xml
└── Kobra_Neo_Firmware.iml
└── .gitignore
/source/board/Ascii16_code.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/indexed-image-array/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/文件夹里面的我都换了就是外面这几个没换不知道行不行.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/app/app_uart.cpp:
--------------------------------------------------------------------------------
1 | #include "app_uart.h"
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/source/board/bsp_flash.cpp:
--------------------------------------------------------------------------------
1 | #include "bsp_flash.h"
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/source/framework/cores/pins_arduino.h:
--------------------------------------------------------------------------------
1 | // API compatibility
2 | #include "variant.h"
--------------------------------------------------------------------------------
/source/Marlin/Version.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/Version.h
--------------------------------------------------------------------------------
/source/board/bsp_init.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/board/bsp_init.cpp
--------------------------------------------------------------------------------
/workspace/bin_expand.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/workspace/bin_expand.exe
--------------------------------------------------------------------------------
/source/board/bsp_spi_tft.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/board/bsp_spi_tft.h
--------------------------------------------------------------------------------
/source/board/bsp_timer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/board/bsp_timer.cpp
--------------------------------------------------------------------------------
/indexed-image-array/input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/indexed-image-array/input.png
--------------------------------------------------------------------------------
/source/board/bsp_spi_tft.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/board/bsp_spi_tft.cpp
--------------------------------------------------------------------------------
/workspace/Flash_HC32F46x.FLM:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/workspace/Flash_HC32F46x.FLM
--------------------------------------------------------------------------------
/source/Marlin/src/MarlinCore.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/MarlinCore.cpp
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/marlinui.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/marlinui.cpp
--------------------------------------------------------------------------------
/source/board/bsp_flash.h:
--------------------------------------------------------------------------------
1 | #ifndef __BSP_FLASH_H__
2 | #define __BSP_FLASH_H__
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_main.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/menu/menu_main.cpp
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_tune.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/menu/menu_tune.cpp
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/tft_string.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/tft/tft_string.cpp
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/extui/AC_spi_dgus.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/extui/AC_spi_dgus.h
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_motion.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/menu/menu_motion.cpp
--------------------------------------------------------------------------------
/source/drivers/library/inc/hc32f46x_dcu.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/drivers/library/inc/hc32f46x_dcu.h
--------------------------------------------------------------------------------
/indexed-image-array/indexed-image-array.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/indexed-image-array/indexed-image-array.exe
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/extui/AC_spi_dgus.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/extui/AC_spi_dgus.cpp
--------------------------------------------------------------------------------
/source/compoment/sdio/sd_card/inc/sdmmc_cmd.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/compoment/sdio/sd_card/inc/sdmmc_cmd.h
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/GCONF.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/framework/TMCStepper/source/GCONF.cpp
--------------------------------------------------------------------------------
/source/drivers/board/board_cfg.h:
--------------------------------------------------------------------------------
1 | /*********/
2 | #ifndef _BSP_CFG_H_
3 | #define _BSP_CFG_H_
4 | #define __PRINT_TO_TERMINAL //debug switch
5 | #endif
6 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_configuration.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/menu/menu_configuration.cpp
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/fontdata/profont_22.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/tft/fontdata/profont_22.cpp
--------------------------------------------------------------------------------
/source/app/app_uart.h:
--------------------------------------------------------------------------------
1 | #ifndef __APP_UART_H__
2 | #define __APP_UART_H__
3 |
4 |
5 | #include "hc32_ddl.h"
6 |
7 |
8 |
9 |
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/fontdata/helvetica_14.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiftoo/Kobra_Neo_Firmware/master/source/Marlin/src/lcd/tft/fontdata/helvetica_14.cpp
--------------------------------------------------------------------------------
/source/drivers/board/startup.cpp:
--------------------------------------------------------------------------------
1 | #include "startup.h"
2 |
3 |
4 | uint32_t F_CPU;
5 |
6 |
7 | void f_cpu_init(uint32_t clock)
8 | {
9 | F_CPU = clock;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/source/board/bsp_ots.h:
--------------------------------------------------------------------------------
1 | #ifndef __BSP_OTS_H__
2 | #define __BSP_OTS_H__
3 |
4 |
5 |
6 |
7 | void bsp_ots_init(void);
8 | void test_ots(void);
9 |
10 |
11 |
12 |
13 | #endif
14 |
15 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/source/framework/cores/Arduino.cpp:
--------------------------------------------------------------------------------
1 | #include "arduino.h"
2 | #include "stdlib.h"
3 |
4 |
5 | int32_t random(int32_t min, int32_t max)
6 | {
7 | return min + rand() % (max - min);
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/source/board/bsp_wdt.h:
--------------------------------------------------------------------------------
1 | #ifndef __BSP_WDT_H__
2 | #define __BSP_WDT_H__
3 |
4 |
5 | #include "hc32_ddl.h"
6 |
7 |
8 | void bsp_wdt_init(void);
9 | void bsp_wdt_refresh(void);
10 |
11 |
12 | #endif
13 |
14 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/source/drivers/board/board_adc.cpp:
--------------------------------------------------------------------------------
1 | #include "board_adc.h"
2 |
3 |
4 | void setup_adcs(void)
5 | {
6 |
7 | }
8 |
9 | void adc_main(void)
10 | {
11 |
12 | }
13 |
14 | uint16_t adc_read(adc_dev *dev, uint8_t channel)
15 | {
16 |
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/source/framework/cores/iwdg.cpp:
--------------------------------------------------------------------------------
1 | #include "iwdg.h"
2 | #include "bsp_wdt.h"
3 |
4 |
5 | void iwdg_init(void)
6 | {
7 | bsp_wdt_init();
8 | bsp_wdt_refresh();
9 | }
10 |
11 | void iwdg_feed(void)
12 | {
13 | bsp_wdt_refresh();
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/indexed-image-array/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "indexed-image-array"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 |
8 | [dependencies]
9 | image = "0.24.6"
10 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/TMC_MACROS.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define DEBUG_PRINT(CFG, VAL) Serial.print(CFG); Serial.print('('); Serial.print(VAL, HEX); Serial.println(')')
4 | //#define WRITE_REG(R) write(R##_register.address, R##_register.sr)
5 | //#define READ_REG(R) read(R##_register.address)
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/source/framework/cores/wirish_time.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _WIRISH_WIRISH_TIME_H_
3 | #define _WIRISH_WIRISH_TIME_H_
4 |
5 | #include "libmaple_types.h"
6 |
7 |
8 | #ifdef __cplusplus
9 | extern "C"{
10 | #endif // __cplusplus
11 |
12 | void yield(void);
13 | #ifdef __cplusplus
14 | }
15 | #endif // __cplusplus
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/.idea/Kobra_Neo_Firmware.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/SERIAL_SWITCH.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | //#include
4 | #include
5 | #include "TMC_platforms.h"
6 |
7 | class SSwitch {
8 | public:
9 | SSwitch(const uint16_t pin1, const uint16_t pin2, const uint8_t address);
10 | void active();
11 | private:
12 | const uint16_t p1;
13 | const uint16_t p2;
14 | const uint8_t addr;
15 | };
16 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/SERIAL_SWITCH.cpp:
--------------------------------------------------------------------------------
1 | #include "SERIAL_SWITCH.h"
2 |
3 | SSwitch::SSwitch( const uint16_t pin1, const uint16_t pin2, const uint8_t address) :
4 | p1(pin1),
5 | p2(pin2),
6 | addr(address)
7 | {
8 | // pinMode(pin1, OUTPUT);
9 | // pinMode(pin2, OUTPUT);
10 | }
11 |
12 | void SSwitch::active() {
13 | // digitalWrite(p1, addr & 0b01 ? HIGH : LOW);
14 | // digitalWrite(p2, addr & 0b10 ? HIGH : LOW);
15 | }
16 |
--------------------------------------------------------------------------------
/workspace/RTE/_firmware_Release/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'anycubic'
7 | * Target: 'firmware_Release'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "HC32F460KETA.h"
18 |
19 |
20 |
21 | #endif /* RTE_COMPONENTS_H */
22 |
--------------------------------------------------------------------------------
/source/framework/cores/itoa.h:
--------------------------------------------------------------------------------
1 | #ifndef _ITOA_
2 | #define _ITOA_
3 |
4 | #ifdef __cplusplus
5 | extern "C"{
6 | #endif // __cplusplus
7 |
8 | extern char* itoa( int value, char *string, int radix ) ;
9 | extern char* ltoa( long value, char *string, int radix ) ;
10 | extern char* utoa( unsigned value, char *string, int radix ) ;
11 | extern char* ultoa( unsigned long value, char *string, int radix ) ;
12 |
13 | #ifdef __cplusplus
14 | } // extern "C"
15 | #endif // __cplusplus
16 |
17 | #endif // _ITOA_
18 |
--------------------------------------------------------------------------------
/source/board/bsp_rmu.h:
--------------------------------------------------------------------------------
1 | #ifndef __BSP_RMU_H__
2 | #define __BSP_RMU_H__
3 |
4 |
5 | #include "hc32_ddl.h"
6 |
7 |
8 | typedef enum {
9 | RST_CAU_POWER_ON = 0x01,
10 | RST_CAU_EXTERNAL = 0x02,
11 | RST_CAU_BROWN_OUT = 0x04,
12 | RST_CAU_WATCHDOG = 0x08,
13 | RST_CAU_JTAG = 0x10,
14 | RST_CAU_SOFTWARE = 0x20,
15 | RST_CAU_BACKUP = 0x40,
16 | } rst_cause_t;
17 |
18 |
19 | uint8_t rmu_get_reset_cause(void);
20 | uint8_t rmu_clear_reset_cause(void);
21 |
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/source/drivers/board/board_sdio.cpp:
--------------------------------------------------------------------------------
1 | #include "board_sdio.h"
2 | #include "bsp_sdio.h"
3 |
4 |
5 | en_result_t sdio_main(void)
6 | {
7 |
8 | }
9 |
10 | bool steup_sdio(void)
11 | {
12 | hal_sdio_init();
13 | return true;
14 | }
15 |
16 | bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data)
17 | {
18 | return sdio_read(blockAddress, data);
19 | }
20 |
21 | bool SDIO_WriteBlockDMA(uint32_t blockAddress, const uint8_t *data)
22 | {
23 | return sdio_write(blockAddress, (const uint8_t *)data);
24 | }
25 |
26 |
27 |
--------------------------------------------------------------------------------
/source/app/app_sserial_test.cpp:
--------------------------------------------------------------------------------
1 | #include "hc32_ddl.h"
2 | #include "bsp_timer.h"
3 | #include "SoftwareSerial.h"
4 |
5 |
6 | #if TEST_SOFT_SERIAL
7 |
8 | SoftwareSerial mySerial(PA3, PA2);
9 |
10 |
11 | void app_sserial_test(void)
12 | {
13 | timer0B_init();
14 |
15 | mySerial.begin(115200);
16 |
17 | mySerial.println("SoftwareSerial print test\n");
18 |
19 | while(1) {
20 |
21 | if(mySerial.read() == 'A') {
22 | mySerial.println("SoftwareSerial print\n");
23 | }
24 | }
25 | }
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/sdio.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifdef ARDUINO_ARCH_STM32F1
4 |
5 | #include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density
6 |
7 | bool SDIO_Init() {
8 | return (steup_sdio());
9 | }
10 |
11 | bool SDIO_ReadBlock(uint32_t blockAddress, uint8_t *data) {
12 | uint32_t retries = 3;
13 | while (retries--) if (SDIO_ReadBlock_DMA(blockAddress, data)) return true;
14 | return false;
15 | }
16 |
17 | bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) {
18 | return SDIO_WriteBlockDMA(blockAddress,data);
19 | }
20 |
21 | #endif // ARDUINO_ARCH_STM32F1
22 |
--------------------------------------------------------------------------------
/source/board/bsp_rmu.cpp:
--------------------------------------------------------------------------------
1 | #include "bsp_rmu.h"
2 |
3 |
4 | uint8_t rmu_get_reset_cause(void)
5 | {
6 | uint8_t res;
7 |
8 | stc_rmu_rstcause_t stcRmuRstCause;
9 |
10 | MEM_ZERO_STRUCT(stcRmuRstCause);
11 |
12 | RMU_GetResetCause(&stcRmuRstCause);
13 |
14 | if(Set == stcRmuRstCause.enSoftware) {
15 | res = RST_CAU_SOFTWARE;
16 | } else if(Set == stcRmuRstCause.enWdt) {
17 | res = RST_CAU_WATCHDOG;
18 | } else if(Set == stcRmuRstCause.enRstPin) {
19 | res = RST_CAU_EXTERNAL;
20 | }
21 |
22 | return res;
23 | }
24 |
25 | uint8_t rmu_clear_reset_cause(void)
26 | {
27 | RMU_ClrResetFlag();
28 |
29 | return 0;
30 | }
31 |
32 |
33 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/SW_SPI.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "TMC_platforms.h"
5 |
6 | class SW_SPIClass {
7 | public:
8 | SW_SPIClass(uint16_t sw_mosi_pin, uint16_t sw_miso_pin, uint16_t sw_sck_pin);
9 | void init();
10 | void begin() {};
11 | uint8_t transfer(uint8_t ulVal);
12 | uint16_t transfer16(uint16_t data);
13 | void endTransaction() {};
14 | private:
15 | const uint16_t mosi_pin,
16 | miso_pin,
17 | sck_pin;
18 |
19 | #if defined(ARDUINO_ARCH_AVR)
20 | fastio_bm mosi_bm,
21 | miso_bm,
22 | sck_bm;
23 | fastio_reg mosi_register,
24 | miso_register,
25 | sck_register;
26 | #endif
27 | };
28 |
--------------------------------------------------------------------------------
/source/drivers/board/board_sdio.h:
--------------------------------------------------------------------------------
1 | #ifndef __BOARD_SDIO_H__
2 | #define __BOARD_SDIO_H__
3 |
4 |
5 | #include
6 |
7 | #include "hc32_ddl.h"
8 |
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | /* SD sector && count */
15 | #define SD_SECTOR_START (0u)
16 | #define SD_SECTOR_COUNT (4u)
17 | #define SD_COUNT (1u)//ENDER3
18 |
19 |
20 | extern en_result_t sdio_main(void);
21 | extern bool steup_sdio(void);
22 | extern bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data);
23 | extern bool SDIO_WriteBlockDMA(uint32_t blockAddress, const uint8_t *data);
24 |
25 |
26 |
27 | #ifdef __cplusplus
28 | };
29 | #endif
30 |
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/source/compoment/sdio/sdio_hal.h:
--------------------------------------------------------------------------------
1 | #ifndef _CLASS_SDIOI_H_
2 | #define _CLASS_SDIOI_H_
3 |
4 | #include "hc32_ddl.h"
5 | #include "sdmmc_cmd.h"
6 | #include "sd_card.h"
7 |
8 | #define sdio_timeout 100u
9 |
10 | class Sdioc_Class
11 | {
12 | public:
13 | Sdioc_Class(M4_SDIOC_TypeDef *SDIOCx);
14 | ~Sdioc_Class(void);
15 | public:
16 | static en_result_t init(void);
17 | static void end(M4_SDIOC_TypeDef *SDIOCx);
18 | static en_result_t erase(uint32_t BlkStartAddr,uint32_t BlkEndAddr);
19 | static en_result_t read(uint32_t BlockAddr,uint16_t BlockCnt,uint8_t *dest);
20 | static en_result_t write(uint32_t BlockAddr,uint16_t BlockCnt, const uint8_t *dest);
21 | private:
22 | };
23 |
24 | extern Sdioc_Class SDIO;
25 |
26 | #endif
27 |
28 | /*****************end of file*******************/
29 |
30 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/TMCStepper_UTILITY.h:
--------------------------------------------------------------------------------
1 | #ifndef TMCStepper_UTILITY_h
2 | #define TMCStepper_UTILITY_h
3 |
4 | void print_HEX(uint32_t data) {
5 | for(uint8_t B=24; B>=4; B-=8){
6 | Serial.print((data>>(B+4))&0xF, HEX);
7 | Serial.print((data>>B)&0xF, HEX);
8 | Serial.print(":");
9 | }
10 | Serial.print((data>>4)&0xF, HEX);
11 | Serial.print(data&0xF, HEX);
12 | }
13 |
14 | void print_BIN(uint32_t data) {
15 | int b = 31;
16 | for(; b>=24; b--){
17 | Serial.print((data>>b)&0b1);
18 | }
19 | Serial.print(".");
20 | for(; b>=16; b--){
21 | Serial.print((data>>b)&0b1);
22 | }
23 | Serial.print(".");
24 | for(; b>=8; b--){
25 | Serial.print((data>>b)&0b1);
26 | }
27 | Serial.print(".");
28 | for(; b>=0; b--){
29 | Serial.print((data>>b)&0b1);
30 | }
31 | }
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/source/framework/cores/io.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _WIRISH_IO_H_
3 | #define _WIRISH_IO_H_
4 |
5 | #include "../cores/libmaple_types.h"
6 | #include "../board/startup.h"
7 |
8 | typedef enum WiringPinMode {
9 | OUTPUT,
10 | OUTPUT_OPEN_DRAIN,
11 | INPUT,
12 | INPUT_ANALOG,
13 | INPUT_PULLUP,
14 | INPUT_PULLDOWN,
15 | INPUT_FLOATING,
16 | PWM,
17 | PWM_OPEN_DRAIN,
18 | } WiringPinMode;
19 |
20 | void pinMode(uint8 pin, WiringPinMode mode);
21 |
22 | #define HIGH 0x1
23 | #define LOW 0x0
24 |
25 | void digitalWrite(uint8 pin, uint8 val);
26 | uint32 digitalRead(uint8 pin);
27 |
28 | void pwmWrite(uint8 pin, uint16 duty_cycle16);
29 | void analogWrite(uint8 pin, int duty_cycle8);
30 | uint16 analogRead(uint8 pin);
31 | void gpio_set_mode(uint8 pin, WiringPinMode mode);
32 | WiringPinMode gpio_get_mode(uint8 PinNum) ;
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/SGCSCONF.cpp:
--------------------------------------------------------------------------------
1 | #include "TMCStepper.h"
2 | #include "TMC_MACROS.h"
3 |
4 | //#define SET_REG(SETTING) SGCSCONF_register.SETTING = B; write(SGCSCONF_register.address, SGCSCONF_register.sr);
5 | //#define GET_REG(SETTING) return SGCSCONF_register.SETTING;
6 | //
7 | //uint32_t TMC2660Stepper::SGCSCONF() { return SGCSCONF_register.sr; }
8 | //void TMC2660Stepper::SGCSCONF(uint32_t data) {
9 | // SGCSCONF_register.sr = data;
10 | // write(SGCSCONF_register.address, SGCSCONF_register.sr);
11 | //}
12 | //
13 | //void TMC2660Stepper::sfilt(bool B) { SET_REG(sfilt); }
14 | //void TMC2660Stepper::sgt(uint8_t B) { SET_REG(sgt); }
15 | //void TMC2660Stepper::cs(uint8_t B) { SET_REG(cs); }
16 | //
17 | //bool TMC2660Stepper::sfilt() { GET_REG(sfilt); }
18 | //uint8_t TMC2660Stepper::sgt(){ GET_REG(sgt); }
19 | //uint8_t TMC2660Stepper::cs() { GET_REG(cs); }
20 |
--------------------------------------------------------------------------------
/source/board/bsp_wdt.cpp:
--------------------------------------------------------------------------------
1 | #include "bsp_wdt.h"
2 |
3 |
4 | // pclk = system_clock/div4 = 50M
5 | // max cycle = 65536
6 | // max feed interval = 65536 / (50000000/8192) = 10.7s
7 | void bsp_wdt_init(void)
8 | {
9 | stc_wdt_init_t stcWdtInit;
10 |
11 | /* configure structure initialization */
12 | MEM_ZERO_STRUCT(stcWdtInit);
13 |
14 | stcWdtInit.enClkDiv = WdtPclk3Div8192;
15 | stcWdtInit.enCountCycle = WdtCountCycle65536;
16 | stcWdtInit.enRefreshRange = WdtRefresh100Pct;
17 | stcWdtInit.enSleepModeCountEn = Disable;
18 | stcWdtInit.enRequestType = WdtTriggerResetRequest;
19 | WDT_Init(&stcWdtInit);
20 | }
21 |
22 | void bsp_wdt_refresh(void)
23 | {
24 | en_result_t enRet = Error;
25 | enRet = WDT_RefreshCounter();
26 |
27 | if(enRet != Ok) {
28 | printf("Failed at function: %s, line: %d\n", __FUNCTION__, __LINE__);
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/IHOLD_IRUN.cpp:
--------------------------------------------------------------------------------
1 | #include "TMCStepper.h"
2 | #include "TMC_MACROS.h"
3 |
4 | #define SET_REG(SETTING) IHOLD_IRUN_register.SETTING = B; write(IHOLD_IRUN_register.address, IHOLD_IRUN_register.sr);
5 | #define GET_REG(SETTING) return IHOLD_IRUN_register.SETTING;
6 |
7 | // IHOLD_IRUN
8 | uint32_t TMCStepper::IHOLD_IRUN() { return IHOLD_IRUN_register.sr; }
9 | void TMCStepper::IHOLD_IRUN(uint32_t input) {
10 | IHOLD_IRUN_register.sr = input;
11 | write(IHOLD_IRUN_register.address, IHOLD_IRUN_register.sr);
12 | }
13 |
14 | void TMCStepper::ihold(uint8_t B) { SET_REG(ihold); }
15 | void TMCStepper::irun(uint8_t B) { SET_REG(irun); }
16 | void TMCStepper::iholddelay(uint8_t B) { SET_REG(iholddelay); }
17 |
18 | uint8_t TMCStepper::ihold() { GET_REG(ihold); }
19 | uint8_t TMCStepper::irun() { GET_REG(irun); }
20 | uint8_t TMCStepper::iholddelay() { GET_REG(iholddelay); }
21 |
22 |
--------------------------------------------------------------------------------
/source/framework/cores/io.cpp:
--------------------------------------------------------------------------------
1 | #include "io.h"
2 | #include "board_gpio.h"
3 |
4 |
5 | void gpio_set_mode(uint8 pin, WiringPinMode mode)
6 | {
7 | stc_port_init_t stcPortInit;
8 |
9 | MEM_ZERO_STRUCT(stcPortInit);
10 |
11 | switch(mode) {
12 |
13 | case OUTPUT:
14 | stcPortInit.enPinMode = Pin_Mode_Out;
15 | stcPortInit.enPullUp = Disable;
16 | break;
17 |
18 | case INPUT:
19 | case INPUT_PULLDOWN:
20 | stcPortInit.enPinMode = Pin_Mode_In;
21 | stcPortInit.enPullUp = Disable;
22 | break;
23 |
24 | case INPUT_PULLUP:
25 | stcPortInit.enPinMode = Pin_Mode_In;
26 | stcPortInit.enPullUp = Enable;
27 | break;
28 |
29 | default:
30 | break;
31 | }
32 |
33 | PORT_InitMapp(pin, &stcPortInit);
34 | }
35 |
36 | void pinMode(uint8 pin, WiringPinMode mode)
37 | {
38 | gpio_set_mode(pin, mode);
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/inc/Conditionals_LCD.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/shared/esp_wifi.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | void esp_wifi_init();
25 |
--------------------------------------------------------------------------------
/source/Marlin/src/libs/crc16.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include
25 |
26 | void crc16(uint16_t *crc, const void * const data, uint16_t cnt);
27 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_mmu2.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include
25 |
26 | void menu_mmu2();
27 | void mmu2_M600();
28 | uint8_t mmu2_choose_filament();
29 |
--------------------------------------------------------------------------------
/source/framework/cores/Server.h:
--------------------------------------------------------------------------------
1 | /*
2 | Server.h - Base class that provides Server
3 | Copyright (c) 2011 Adrian McEwen. All right reserved.
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef server_h
21 | #define server_h
22 |
23 | #include "Print.h"
24 |
25 | class Server : public Print {
26 | public:
27 | virtual void begin() =0;
28 | };
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/SHORT_CONF.cpp:
--------------------------------------------------------------------------------
1 | #include "TMCStepper.h"
2 | #include "TMC_MACROS.h"
3 |
4 | //#define SET_REG(SETTING) SHORT_CONF_register.SETTING = B; write(SHORT_CONF_register.address, SHORT_CONF_register.sr)
5 | //#define GET_REG(SETTING) return SHORT_CONF_register.SETTING
6 | //
7 | //uint32_t TMC2160Stepper::SHORT_CONF() { return SHORT_CONF_register.sr; }
8 | //void TMC2160Stepper::SHORT_CONF(uint32_t input) {
9 | // SHORT_CONF_register.sr = input;
10 | // write(SHORT_CONF_register.address, SHORT_CONF_register.sr);
11 | //}
12 | //
13 | //void TMC2160Stepper::s2vs_level(uint8_t B) { SET_REG(s2vs_level); }
14 | //void TMC2160Stepper::s2g_level(uint8_t B) { SET_REG(s2g_level); }
15 | //void TMC2160Stepper::shortfilter(uint8_t B) { SET_REG(shortfilter); }
16 | //void TMC2160Stepper::shortdelay(bool B) { SET_REG(shortdelay); }
17 | //uint8_t TMC2160Stepper::s2vs_level() { GET_REG(s2vs_level); }
18 | //uint8_t TMC2160Stepper::s2g_level() { GET_REG(s2g_level); }
19 | //uint8_t TMC2160Stepper::shortfilter() { GET_REG(shortfilter); }
20 | //bool TMC2160Stepper::shortdelay() { GET_REG(shortdelay); }
21 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/inc/Conditionals_adv.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #if defined(USBD_USE_CDC_COMPOSITE) && DISABLED(NO_SD_HOST_DRIVE)
25 | #define HAS_SD_HOST_DRIVE 1
26 | #endif
27 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/SMARTEN.cpp:
--------------------------------------------------------------------------------
1 | #include "TMCStepper.h"
2 | #include "TMC_MACROS.h"
3 |
4 | //#define SET_REG(SETTING) SMARTEN_register.SETTING = B; write(SMARTEN_register.address, SMARTEN_register.sr)
5 | //#define GET_REG(SETTING) return SMARTEN_register.SETTING
6 | //
7 | //uint32_t TMC2660Stepper::SMARTEN() { return SMARTEN_register.sr; }
8 | //void TMC2660Stepper::SMARTEN(uint32_t data) {
9 | // SMARTEN_register.sr = data;
10 | // write(SMARTEN_register.address, SMARTEN_register.sr);
11 | //}
12 | //
13 | //void TMC2660Stepper::seimin(bool B) { SET_REG(seimin); }
14 | //void TMC2660Stepper::sedn(uint8_t B) { SET_REG(sedn); }
15 | //void TMC2660Stepper::semax(uint8_t B) { SET_REG(semax); }
16 | //void TMC2660Stepper::seup(uint8_t B) { SET_REG(seup); }
17 | //void TMC2660Stepper::semin(uint8_t B) { SET_REG(semin); }
18 | //
19 | //bool TMC2660Stepper::seimin() { GET_REG(seimin); }
20 | //uint8_t TMC2660Stepper::sedn() { GET_REG(sedn); }
21 | //uint8_t TMC2660Stepper::semax() { GET_REG(semax); }
22 | //uint8_t TMC2660Stepper::seup() { GET_REG(seup); }
23 | //uint8_t TMC2660Stepper::semin() { GET_REG(semin); }
24 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/fastio.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | * Copyright (c) 2017 Victor Perez
8 | *
9 | * This program is free software: you can redistribute it and/or modify
10 | * it under the terms of the GNU General Public License as published by
11 | * the Free Software Foundation, either version 3 of the License, or
12 | * (at your option) any later version.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program. If not, see .
21 | *
22 | */
23 | #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
24 |
25 | #include "../../inc/MarlinConfig.h"
26 |
27 | void FastIO_init() {
28 | }
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M400.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../module/stepper.h"
25 |
26 | /**
27 | * M400: Finish all moves
28 | */
29 | void GcodeSuite::M400() {
30 |
31 | planner.synchronize();
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/source/Marlin/src/libs/dtostrf.h:
--------------------------------------------------------------------------------
1 | /*
2 | dtostrf - Emulation for dtostrf function from avr-libc
3 | Copyright (c) 2013 Arduino. All rights reserved.
4 | Written by Cristian Maglie
5 |
6 | This library is free software; you can redistribute it and/or
7 | modify it under the terms of the GNU Lesser General Public
8 | License as published by the Free Software Foundation; either
9 | version 2.1 of the License, or (at your option) any later version.
10 |
11 | This library is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | Lesser General Public License for more details.
15 |
16 | You should have received a copy of the GNU Lesser General Public
17 | License along with this library; if not, write to the Free Software
18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 | #ifndef __DTOSTRF_H__
21 | #define __DTOSTRF_H__
22 |
23 |
24 | #include
25 |
26 |
27 | char *dtostrf(double val, signed char width, unsigned char prec, char *sout);
28 |
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/host/M119.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../module/endstops.h"
25 |
26 | /**
27 | * M119: Output endstop states to serial output
28 | */
29 | void GcodeSuite::M119() {
30 |
31 | endstops.report_states();
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/source/board/bsp_ots.cpp:
--------------------------------------------------------------------------------
1 | #include "bsp_ots.h"
2 | #include "hc32_ddl.h"
3 |
4 |
5 | #define OTS_CLK_SEL_XTAL (0u)
6 | #define OTS_CLK_SEL_HRC (1u)
7 |
8 | /* Select XTAL as OTS clock. */
9 | #define OTS_CLK_SEL (OTS_CLK_SEL_XTAL)
10 |
11 | #define SYS_CLOCK_FREQ_MHZ (SystemCoreClock / 1000000ul)
12 |
13 | #define TIMEOUT_MS (10u)
14 |
15 |
16 | void bsp_ots_init(void)
17 | {
18 |
19 | // OTS must enable LRC
20 | CLK_LrcCmd(Enable);
21 | PWC_Fcg3PeriphClockCmd(PWC_FCG3_PERIPH_OTS, Enable);
22 |
23 | stc_ots_init_t stcOtsInit;
24 |
25 | stcOtsInit.enAutoOff = OtsAutoOff_Disable;
26 | stcOtsInit.enClkSel = OtsClkSel_Xtal;
27 | stcOtsInit.u8ClkFreq = (uint8_t)SYS_CLOCK_FREQ_MHZ;
28 |
29 | OTS_Init(&stcOtsInit);
30 | }
31 |
32 | void test_ots(void)
33 | {
34 | en_result_t enRet;
35 | float m_f32Temperature = .0f;
36 |
37 | //Start OTS, check OTS, get the temperature value.
38 | enRet = OTS_StartGetTemp(&m_f32Temperature, TIMEOUT_MS);
39 | if (Ok == enRet) {
40 | printf("\nChip temp: %.2f.", m_f32Temperature);
41 | } else {
42 | printf("\nOTS error, code %d.", enRet);
43 | }
44 | }
45 |
46 |
47 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/inc/Conditionals_post.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // If no real or emulated EEPROM selected, fall back to SD emulation
25 | #if USE_FALLBACK_EEPROM
26 | #define SDCARD_EEPROM_EMULATION
27 | #elif EITHER(I2C_EEPROM, SPI_EEPROM)
28 | #define USE_SHARED_EEPROM 1
29 | #endif
30 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M997.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 |
25 | #if ENABLED(PLATFORM_M997_SUPPORT)
26 |
27 | /**
28 | * M997: Perform in-application firmware update
29 | */
30 | void GcodeSuite::M997() {
31 |
32 | flashFirmware(parser.intval('S'));
33 |
34 | }
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/source/framework/cores/libmaple_types.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _LIBMAPLE_LIBMAPLE_TYPES_H_
3 | #define _LIBMAPLE_LIBMAPLE_TYPES_H_
4 |
5 | #include
6 | #include "wirish_types.h"
7 |
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | typedef unsigned char uint8;
14 | typedef unsigned short uint16;
15 | typedef uint32_t uint32;
16 | typedef unsigned long long uint64;
17 |
18 | typedef signed char int8;
19 | typedef short int16;
20 | typedef int int32;
21 | typedef long long int64;
22 |
23 | typedef void (*voidFuncPtr)(void);
24 | typedef void (*voidArgumentFuncPtr)(void *);
25 |
26 | #define __IO volatile
27 | #define __attr_flash __attribute__((section (".USER_FLASH")))
28 | #define __packed __attribute__((__packed__))
29 | #define __deprecated __attribute__((__deprecated__))
30 | #define __weak __attribute__((weak))
31 | #ifndef __always_inline
32 | #define __always_inline __attribute__((always_inline))
33 | #endif
34 | #ifndef __unused
35 | #define __unused __attribute__((unused))
36 | #endif
37 |
38 | #ifndef NULL
39 | #define NULL 0
40 | #endif
41 |
42 | #ifndef offsetof
43 | #define offsetof(type, member) __builtin_offsetof(type, member)
44 | #endif
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/DRV_CONF.cpp:
--------------------------------------------------------------------------------
1 | #include "TMCStepper.h"
2 | #include "TMC_MACROS.h"
3 |
4 | //#define SET_REG(SETTING) DRV_CONF_register.SETTING = B; write(DRV_CONF_register.address, DRV_CONF_register.sr);
5 | //#define GET_REG(SETTING) return DRV_CONF_register.SETTING;
6 | //
7 | //// W: DRV_CONF
8 | //uint32_t TMC2160Stepper::DRV_CONF() { return DRV_CONF_register.sr; }
9 | //void TMC2160Stepper::DRV_CONF(uint32_t input) {
10 | // DRV_CONF_register.sr = input;
11 | // write(DRV_CONF_register.address, DRV_CONF_register.sr);
12 | //}
13 | //
14 | //void TMC2160Stepper::bbmtime(uint8_t B) { SET_REG(bbmtime); }
15 | //void TMC2160Stepper::bbmclks(uint8_t B) { SET_REG(bbmclks); }
16 | //void TMC2160Stepper::otselect(uint8_t B) { SET_REG(otselect); }
17 | //void TMC2160Stepper::drvstrength(uint8_t B) { SET_REG(drvstrength); }
18 | //void TMC2160Stepper::filt_isense(uint8_t B) { SET_REG(filt_isense); }
19 | //uint8_t TMC2160Stepper::bbmtime() { GET_REG(bbmtime); }
20 | //uint8_t TMC2160Stepper::bbmclks() { GET_REG(bbmclks); }
21 | //uint8_t TMC2160Stepper::otselect() { GET_REG(otselect); }
22 | //uint8_t TMC2160Stepper::drvstrength() { GET_REG(drvstrength); }
23 | //uint8_t TMC2160Stepper::filt_isense() { GET_REG(filt_isense); }
24 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/host/M110.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../queue.h" // for last_N
25 |
26 | /**
27 | * M110: Set Current Line Number
28 | */
29 | void GcodeSuite::M110() {
30 |
31 | if (parser.seenval('N'))
32 | queue.last_N[queue.command_port()] = parser.value_long();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/shared/math_32bit.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include "../../core/macros.h"
25 |
26 | /**
27 | * Math helper functions for 32 bit CPUs
28 | */
29 | static FORCE_INLINE uint32_t MultiU32X24toH32(uint32_t longIn1, uint32_t longIn2) {
30 | return ((uint64_t)longIn1 * longIn2 + 0x00800000) >> 24;
31 | }
32 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/units/M82_M83.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 |
25 | /**
26 | * M82: Set E codes absolute (default)
27 | */
28 | void GcodeSuite::M82() { set_e_absolute(); }
29 |
30 | /**
31 | * M83: Set E codes relative while in Absolute Coordinates (G90) mode
32 | */
33 | void GcodeSuite::M83() { set_e_relative(); }
34 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/shared/eeprom_api.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | *
4 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5 | * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
6 | * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
7 | * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
8 | *
9 | * This program is free software: you can redistribute it and/or modify
10 | * it under the terms of the GNU General Public License as published by
11 | * the Free Software Foundation, either version 3 of the License, or
12 | * (at your option) any later version.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program. If not, see .
21 | *
22 | */
23 | #include "../../inc/MarlinConfigPre.h"
24 |
25 | #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
26 |
27 | #include "eeprom_api.h"
28 | PersistentStore persistentStore;
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/lcd/M117.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../lcd/marlinui.h"
25 |
26 | /**
27 | * M117: Set LCD Status Message
28 | */
29 | void GcodeSuite::M117() {
30 |
31 | if (parser.string_arg && parser.string_arg[0])
32 | ui.set_status(parser.string_arg);
33 | else
34 | ui.reset_status();
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/motion/G80.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfigPre.h"
24 |
25 | #if ENABLED(GCODE_MOTION_MODES)
26 |
27 | #include "../gcode.h"
28 |
29 | /**
30 | * G80: Cancel current motion mode
31 | */
32 | void GcodeSuite::G80() {
33 |
34 | parser.cancel_motion_mode();
35 |
36 | }
37 |
38 | #endif // GCODE_MOTION_MODES
39 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M928.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M928: Start SD Logging
32 | */
33 | void GcodeSuite::M928() {
34 |
35 | card.openLogFile(parser.string_arg);
36 |
37 | }
38 |
39 | #endif // SDSUPPORT
40 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_touch_screen.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfigPre.h"
24 |
25 | #if BOTH(HAS_LCD_MENU, TOUCH_SCREEN_CALIBRATION)
26 |
27 | #include "menu_item.h"
28 | #include "../marlinui.h"
29 |
30 | void touch_screen_calibration() {
31 |
32 | ui.touch_calibration_screen();
33 |
34 | }
35 |
36 | #endif // TOUCH_SCREEN_CALIBRATION
37 |
--------------------------------------------------------------------------------
/source/Marlin/src/core/millis_t.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include
25 |
26 | typedef uint32_t millis_t;
27 |
28 | #define SEC_TO_MS(N) millis_t((N)*1000UL)
29 | #define MIN_TO_MS(N) SEC_TO_MS((N)*60UL)
30 | #define MS_TO_SEC(N) millis_t((N)/1000UL)
31 |
32 | #define PENDING(NOW,SOON) ((int32_t)(NOW-(SOON))<0)
33 | #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
34 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M85.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 |
25 | /**
26 | * M85: Set inactivity shutdown timer with parameter S. To disable set zero (default)
27 | */
28 | void GcodeSuite::M85() {
29 |
30 | if (parser.seen('S')) {
31 | reset_stepper_timeout();
32 | max_inactive_time = parser.value_millis_from_seconds();
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/RAMP_STAT.cpp:
--------------------------------------------------------------------------------
1 | #include "TMCStepper.h"
2 | #include "TMC_MACROS.h"
3 |
4 | #define GET_REG(SETTING) RAMP_STAT_t r{0}; r.sr = RAMP_STAT(); return r.SETTING
5 |
6 |
7 | //uint32_t TMC5130Stepper::RAMP_STAT() {
8 | // return read(RAMP_STAT_t::address);
9 | //}
10 | //
11 | //bool TMC5130Stepper::status_stop_l() { GET_REG(status_stop_l); }
12 | //bool TMC5130Stepper::status_stop_r() { GET_REG(status_stop_r); }
13 | //bool TMC5130Stepper::status_latch_l() { GET_REG(status_latch_l); }
14 | //bool TMC5130Stepper::status_latch_r() { GET_REG(status_latch_r); }
15 | //bool TMC5130Stepper::event_stop_l() { GET_REG(event_stop_l); }
16 | //bool TMC5130Stepper::event_stop_r() { GET_REG(event_stop_r); }
17 | //bool TMC5130Stepper::event_stop_sg() { GET_REG(event_stop_sg); }
18 | //bool TMC5130Stepper::event_pos_reached() { GET_REG(event_pos_reached); }
19 | //bool TMC5130Stepper::velocity_reached() { GET_REG(velocity_reached); }
20 | //bool TMC5130Stepper::position_reached() { GET_REG(position_reached); }
21 | //bool TMC5130Stepper::vzero() { GET_REG(vzero); }
22 | //bool TMC5130Stepper::t_zerowait_active() { GET_REG(t_zerowait_active); }
23 | //bool TMC5130Stepper::second_move() { GET_REG(second_move); }
24 | //bool TMC5130Stepper::status_sg() { GET_REG(status_sg); }
25 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/TMC2209_bitfields.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #pragma pack(push, 1)
3 |
4 | namespace TMC2209_n {
5 | struct IOIN_t {
6 | constexpr static uint8_t address = 0x06;
7 | union {
8 | uint32_t sr;
9 | struct {
10 | bool enn : 1,
11 | : 1,
12 | ms1 : 1,
13 | ms2 : 1,
14 | diag : 1,
15 | : 1,
16 | pdn_uart : 1,
17 | step : 1,
18 | spread_en : 1,
19 | dir : 1;
20 | uint16_t : 14;
21 | uint8_t version : 8;
22 | };
23 | };
24 | };
25 |
26 | struct SGTHRS_t {
27 | constexpr static uint8_t address = 0x40;
28 | uint8_t sr : 8;
29 | };
30 |
31 | struct SG_RESULT_t {
32 | constexpr static uint8_t address = 0x41;
33 | uint16_t sr : 10;
34 | };
35 |
36 | struct COOLCONF_t {
37 | constexpr static uint8_t address = 0x42;
38 | union {
39 | uint16_t sr;
40 | struct {
41 | uint8_t semin : 4,
42 | : 1,
43 | seup : 2,
44 | : 1,
45 | semax : 4,
46 | : 1,
47 | sedn : 2;
48 | bool seimin : 1;
49 | };
50 | };
51 | };
52 | }
53 |
54 | #pragma pack(pop)
55 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M26.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M26: Set SD Card file index
32 | */
33 | void GcodeSuite::M26() {
34 | if (card.isMounted() && parser.seenval('S'))
35 | card.setIndex(parser.value_long());
36 | }
37 |
38 | #endif // SDSUPPORT
39 |
--------------------------------------------------------------------------------
/source/Marlin/src/libs/crc16.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "crc16.h"
24 |
25 | void crc16(uint16_t *crc, const void * const data, uint16_t cnt) {
26 | uint8_t *ptr = (uint8_t *)data;
27 | while (cnt--) {
28 | *crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8));
29 | for (uint8_t i = 0; i < 8; i++)
30 | *crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (*crc << 1));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/probe/G31_G32.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(Z_PROBE_SLED)
26 |
27 | #include "../gcode.h"
28 | #include "../../module/probe.h"
29 |
30 | /**
31 | * G31: Deploy the Z probe
32 | */
33 | void GcodeSuite::G31() { probe.deploy(); }
34 |
35 | /**
36 | * G32: Stow the Z probe
37 | */
38 | void GcodeSuite::G32() { probe.stow(); }
39 |
40 | #endif // Z_PROBE_SLED
41 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M30.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M30 : Delete SD Card file
32 | */
33 | void GcodeSuite::M30() {
34 | if (card.isMounted()) {
35 | card.closefile();
36 | card.removeFile(parser.string_arg);
37 | }
38 | }
39 |
40 | #endif // SDSUPPORT
41 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_998.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // User-defined table 1
25 | // Dummy Thermistor table.. It will ALWAYS read a fixed value.
26 | #ifndef DUMMY_THERMISTOR_998_VALUE
27 | #define DUMMY_THERMISTOR_998_VALUE 25
28 | #endif
29 |
30 | const temp_entry_t temptable_998[] PROGMEM = {
31 | { OV( 1), DUMMY_THERMISTOR_998_VALUE },
32 | { OV(1023), DUMMY_THERMISTOR_998_VALUE }
33 | };
34 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_999.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // User-defined table 2
25 | // Dummy Thermistor table.. It will ALWAYS read a fixed value.
26 | #ifndef DUMMY_THERMISTOR_999_VALUE
27 | #define DUMMY_THERMISTOR_999_VALUE 25
28 | #endif
29 |
30 | const temp_entry_t temptable_999[] PROGMEM = {
31 | { OV( 1), DUMMY_THERMISTOR_999_VALUE },
32 | { OV(1023), DUMMY_THERMISTOR_999_VALUE }
33 | };
34 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/host/M16.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfigPre.h"
24 |
25 | #if ENABLED(EXPECTED_PRINTER_CHECK)
26 |
27 | #include "../gcode.h"
28 | #include "../../MarlinCore.h"
29 |
30 | /**
31 | * M16: Expected Printer Check
32 | */
33 | void GcodeSuite::M16() {
34 |
35 | if (strcmp_P(parser.string_arg, PSTR(MACHINE_NAME)))
36 | kill(GET_TEXT(MSG_KILL_EXPECTED_PRINTER));
37 |
38 | }
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/source/Marlin/src/sd/SdFatUtil.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | /**
25 | * sd/SdFatUtil.h
26 | *
27 | * Arduino SdFat Library
28 | * Copyright (c) 2008 by William Greiman
29 | *
30 | * This file is part of the Arduino Sd2Card Library
31 | */
32 |
33 | /**
34 | * \file
35 | * \brief Useful utility functions.
36 | */
37 |
38 | namespace SdFatUtil {
39 | int FreeRam();
40 | }
41 |
42 | using namespace SdFatUtil; // NOLINT
43 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/tft.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if HAS_GRAPHICAL_TFT
26 |
27 | #include "tft.h"
28 |
29 | //#define DEBUG_GRAPHICAL_TFT
30 | #define DEBUG_OUT ENABLED(DEBUG_GRAPHICAL_TFT)
31 | #include "../../core/debug_out.h"
32 |
33 | uint16_t TFT::buffer[];
34 |
35 | void TFT::init() {
36 | io.Init();
37 | io.InitTFT();
38 | }
39 |
40 | TFT tft;
41 |
42 | #endif // HAS_GRAPHICAL_TFT
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # User-specific uVision files
2 | *.opt
3 | *.uvopt
4 | *.uvoptx
5 | *.uvgui
6 | *.uvgui.*
7 | *.uvguix.*
8 | *.scvd
9 |
10 | # Listing files
11 | *.cod
12 | *.htm
13 | *.i
14 | *.lst
15 | *.map
16 | *.m51
17 | *.m66
18 | # define exception below if needed
19 | *.scr
20 |
21 | # Object and HEX files
22 | *.axf
23 | *.b[0-3][0-9]
24 | *.hex
25 | *.d
26 | *.crf
27 | *.elf
28 | *.hex
29 | *.h86
30 | *.lib
31 | *.obj
32 | *.o
33 | *.sbr
34 | *.bin
35 |
36 | # Build files
37 | # define exception below if needed
38 | *.bat
39 | *._ia
40 | *.__i
41 | *._ii
42 |
43 | # Generated output files
44 | Listings
45 | Objects
46 | Output
47 | DebugConfig
48 | JLinkLog.txt
49 | project/*.bin
50 |
51 | # Debugger files
52 | # define exception below if needed
53 | *.ini
54 |
55 | # Backup files
56 | *.bak
57 | *.back
58 |
59 | # Other files
60 | *.build_log.htm
61 | *.cdb
62 | *.dep
63 | *.ic
64 | *.lin
65 | *.lnp
66 | *.orc
67 | # define exception below if needed
68 | *.pack
69 | # define exception below if needed
70 | *.pdsc
71 | *.plg
72 | # define exception below if needed
73 | *.sct
74 | *.sfd
75 | *.sfr
76 |
77 | # Miscellaneous
78 | *.tra
79 | *.fed
80 | *.l1p
81 | *.l2p
82 | *.iex
83 |
84 | # To explicitly override the above, define any exceptions here; e.g.:
85 | # !my_customized_scatter_file.sct
86 |
87 | # Source insight project files
88 | /SI/*
89 | *.si4project/
90 |
91 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M120_M121.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../module/endstops.h"
25 |
26 | /**
27 | * M120: Enable endstops and set non-homing endstop state to "enabled"
28 | */
29 | void GcodeSuite::M120() { endstops.enable_globally(true); }
30 |
31 | /**
32 | * M121: Disable endstops and set non-homing endstop state to "disabled"
33 | */
34 | void GcodeSuite::M121() { endstops.enable_globally(false); }
35 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_addon.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include "../lcdprint.h"
25 |
26 | #define _MENU_ITEM_ADDON_START(N,X) do{ \
27 | if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \
28 | N(X)
29 |
30 | #define MENU_ITEM_ADDON_START(X) _MENU_ITEM_ADDON_START(SETCURSOR_X, X)
31 | #define MENU_ITEM_ADDON_START_RJ(X) _MENU_ITEM_ADDON_START(SETCURSOR_X_RJ, X)
32 |
33 | #define MENU_ITEM_ADDON_END() } }while(0)
34 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/calibrate/M12.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #include "../../inc/MarlinConfigPre.h"
23 |
24 | #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
25 |
26 | #include "../gcode.h"
27 | #include "../../module/planner.h"
28 | #include "../../feature/closedloop.h"
29 |
30 | void GcodeSuite::M12() {
31 |
32 | planner.synchronize();
33 |
34 | if (parser.seenval('S'))
35 | closedloop.set(parser.value_int()); // Force a CLC set
36 |
37 | }
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/lcd/M250.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if HAS_LCD_CONTRAST
26 |
27 | #include "../gcode.h"
28 | #include "../../lcd/marlinui.h"
29 |
30 | /**
31 | * M250: Read and optionally set the LCD contrast
32 | */
33 | void GcodeSuite::M250() {
34 | if (parser.seen('C')) ui.set_contrast(parser.value_int());
35 | SERIAL_ECHOLNPAIR("LCD Contrast: ", ui.contrast);
36 | }
37 |
38 | #endif // HAS_LCD_CONTRAST
39 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M21_M22.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M21: Init SD Card
32 | */
33 | void GcodeSuite::M21() { card.mount(); }
34 |
35 | /**
36 | * M22: Release SD Card
37 | */
38 | void GcodeSuite::M22() {
39 |
40 | if (!IS_SD_PRINTING()) card.release();
41 |
42 | }
43 |
44 | #endif // SDSUPPORT
45 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/spi_pins.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | */
19 | #pragma once
20 |
21 | /**
22 | * HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
23 | */
24 |
25 | /**
26 | * STM32F1 Default SPI Pins
27 | *
28 | * SS SCK MISO MOSI
29 | * +-----------------------------+
30 | * SPI1 | PA4 PA5 PA6 PA7 |
31 | * SPI2 | PB12 PB13 PB14 PB15 |
32 | * SPI3 | PA15 PB3 PB4 PB5 |
33 | * +-----------------------------+
34 | * Any pin can be used for Chip Select (SS_PIN)
35 | * SPI1 is enabled by default
36 | */
37 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/shared/HAL_ST7920.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | /**
25 | * HAL/ST7920.h
26 | * For the HALs that provide direct access to the ST7920 display
27 | * (bypassing U8G), it will allow the LIGHTWEIGHT_UI to operate.
28 | */
29 |
30 | #if BOTH(HAS_MARLINUI_U8GLIB, LIGHTWEIGHT_UI)
31 | void ST7920_cs();
32 | void ST7920_ncs();
33 | void ST7920_set_cmd();
34 | void ST7920_set_dat();
35 | void ST7920_write_byte(const uint8_t data);
36 | #endif
37 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/TMC2160_bitfields.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #pragma pack(push, 1)
3 |
4 | namespace TMC2160_n {
5 | struct IOIN_t {
6 | constexpr static uint8_t address = 0x04;
7 | union {
8 | uint32_t sr;
9 | struct {
10 | bool refl_step : 1,
11 | refr_dir : 1,
12 | encb_dcen_cfg4 : 1,
13 | enca_dcin_cfg5 : 1,
14 | drv_enn : 1,
15 | dco_cfg6 : 1,
16 | : 2;
17 | uint16_t : 16;
18 | uint8_t version : 8;
19 | };
20 | };
21 | };
22 |
23 | struct PWMCONF_t {
24 | constexpr static uint8_t address = 0x70;
25 | union {
26 | uint32_t sr;
27 | struct {
28 | uint8_t pwm_ofs : 8,
29 | pwm_grad : 8,
30 | pwm_freq : 2;
31 | bool pwm_autoscale : 1,
32 | pwm_autograd : 1;
33 | uint8_t freewheel : 2,
34 | : 2,
35 | pwm_reg : 4,
36 | pwm_lim : 4;
37 | };
38 | };
39 | };
40 |
41 | struct PWM_SCALE_t {
42 | constexpr static uint8_t address = 0x71;
43 | union {
44 | uint32_t sr : 25;
45 | struct {
46 | uint8_t pwm_scale_sum : 8,
47 | : 8;
48 | uint16_t pwm_scale_auto : 9;
49 | };
50 | };
51 | };
52 | }
53 |
54 | #pragma pack(pop)
55 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/units/G20_G21.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(INCH_MODE_SUPPORT)
26 |
27 | #include "../gcode.h"
28 |
29 | /**
30 | * G20: Set input mode to inches
31 | */
32 | void GcodeSuite::G20() { parser.set_input_linear_units(LINEARUNIT_INCH); }
33 |
34 | /**
35 | * G21: Set input mode to millimeters
36 | */
37 | void GcodeSuite::G21() { parser.set_input_linear_units(LINEARUNIT_MM); }
38 |
39 | #endif // INCH_MODE_SUPPORT
40 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M524.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M524: Abort the current SD print job (started with M24)
32 | */
33 | void GcodeSuite::M524() {
34 |
35 | if (IS_SD_PRINTING())
36 | card.flag.abort_sd_printing = true;
37 | else if (card.isMounted())
38 | card.closefile();
39 |
40 | }
41 |
42 | #endif // SDSUPPORT
43 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/config/M540.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
26 |
27 | #include "../gcode.h"
28 | #include "../../module/stepper.h"
29 |
30 | /**
31 | * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>)
32 | */
33 | void GcodeSuite::M540() {
34 |
35 | if (parser.seen('S'))
36 | planner.abort_on_endstop_hit = parser.value_bool();
37 |
38 | }
39 |
40 | #endif // SD_ABORT_ON_ENDSTOP_HIT
41 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft_io/tft_ids.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define LTDC_RGB 0xABAB
25 | #define SSD1963 0x5761
26 | #define ST7735 0x89F0
27 | #define ST7789 0x8552
28 | #define ST7796 0x7796
29 | #define R61505 0x1505
30 | #define ILI9328 0x9328
31 | #define ILI9341 0x9341
32 | #define ILI9488 0x9488
33 | #define ILI9488_ID1 0x8066 // Some ILI9488 have 0x8066 in the 0x04
34 | #define AUTO 0xFFFF
35 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_110.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define REVERSE_TEMP_SENSOR_RANGE_110 1
25 |
26 | // Pt100 with 1k0 pullup
27 | const temp_entry_t temptable_110[] PROGMEM = {
28 | // only a few values are needed as the curve is very flat
29 | PtLine( 0, 100, 1000),
30 | PtLine( 50, 100, 1000),
31 | PtLine(100, 100, 1000),
32 | PtLine(150, 100, 1000),
33 | PtLine(200, 100, 1000),
34 | PtLine(250, 100, 1000),
35 | PtLine(300, 100, 1000)
36 | };
37 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_147.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define REVERSE_TEMP_SENSOR_RANGE_147 1
25 |
26 | // Pt100 with 4k7 pullup
27 | const temp_entry_t temptable_147[] PROGMEM = {
28 | // only a few values are needed as the curve is very flat
29 | PtLine( 0, 100, 4700),
30 | PtLine( 50, 100, 4700),
31 | PtLine(100, 100, 4700),
32 | PtLine(150, 100, 4700),
33 | PtLine(200, 100, 4700),
34 | PtLine(250, 100, 4700),
35 | PtLine(300, 100, 4700)
36 | };
37 |
--------------------------------------------------------------------------------
/source/Marlin/src/feature/z_stepper_align.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | /**
25 | * feature/z_stepper_align.h
26 | */
27 |
28 | #include "../inc/MarlinConfig.h"
29 |
30 | class ZStepperAlign {
31 | public:
32 | static xy_pos_t xy[NUM_Z_STEPPER_DRIVERS];
33 |
34 | #if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
35 | static xy_pos_t stepper_xy[NUM_Z_STEPPER_DRIVERS];
36 | #endif
37 |
38 | static void reset_to_default();
39 | };
40 |
41 | extern ZStepperAlign z_stepper_align;
42 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/host/M876.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #include "../../inc/MarlinConfig.h"
23 |
24 | #if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
25 |
26 | #include "../../feature/host_actions.h"
27 | #include "../gcode.h"
28 | #include "../../MarlinCore.h"
29 |
30 | /**
31 | * M876: Handle Prompt Response
32 | */
33 | void GcodeSuite::M876() {
34 |
35 | if (parser.seenval('S')) host_response_handler((uint8_t)parser.value_int());
36 |
37 | }
38 |
39 | #endif // HOST_PROMPT_SUPPORT && !EMERGENCY_PARSER
40 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/language/language_el_CY.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | /**
25 | * Greek (Cyprus)
26 | *
27 | * LCD Menu Messages
28 | * See also https://marlinfw.org/docs/development/lcd_language.html
29 | */
30 |
31 | #include "language_el.h"
32 |
33 | namespace Language_el_CY {
34 | using namespace Language_el; // Inherit undefined strings from Greek (or English)
35 |
36 | constexpr uint8_t CHARSIZE = 2;
37 | LSTR LANGUAGE = _UxGT("Greek (Cyprus)");
38 | }
39 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M20.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M20: List SD card to serial output
32 | */
33 | void GcodeSuite::M20() {
34 | if (card.flag.mounted) {
35 | SERIAL_ECHOLNPGM(STR_BEGIN_FILE_LIST);
36 | card.ls();
37 | SERIAL_ECHOLNPGM(STR_END_FILE_LIST);
38 | }
39 | else
40 | SERIAL_ECHO_MSG(STR_NO_MEDIA);
41 | }
42 |
43 | #endif // SDSUPPORT
44 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/temp/M155.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR)
26 |
27 | #include "../gcode.h"
28 | #include "../../module/temperature.h"
29 |
30 | /**
31 | * M155: Set temperature auto-report interval. M155 S
32 | */
33 | void GcodeSuite::M155() {
34 |
35 | if (parser.seenval('S'))
36 | thermalManager.set_auto_report_interval(parser.value_byte());
37 |
38 | }
39 |
40 | #endif // AUTO_REPORT_TEMPERATURES && HAS_TEMP_SENSOR
41 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/TMC5160_bitfields.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #pragma pack(push, 1)
3 |
4 | struct SHORT_CONF_t {
5 | constexpr static uint8_t address = 0x09;
6 | union {
7 | uint32_t sr : 19;
8 | struct {
9 | uint8_t s2vs_level : 4,
10 | : 4,
11 | s2g_level : 4,
12 | : 4,
13 | shortfilter : 2;
14 | bool shortdelay : 1;
15 | };
16 | };
17 | };
18 |
19 | struct DRV_CONF_t {
20 | constexpr static uint8_t address = 0x0A;
21 | union {
22 | uint32_t sr : 22;
23 | struct {
24 | uint8_t bbmtime : 5,
25 | : 3,
26 | bbmclks : 4,
27 | : 4,
28 | otselect : 2,
29 | drvstrength : 2,
30 | filt_isense : 2;
31 | };
32 | };
33 | };
34 |
35 | struct GLOBAL_SCALER_t {
36 | constexpr static uint8_t address = 0x0B;
37 | uint8_t sr;
38 | };
39 |
40 | struct OFFSET_READ_t {
41 | constexpr static uint8_t address = 0x0C;
42 | };
43 |
44 | struct ENC_DEVIATION_t {
45 | constexpr static uint8_t address = 0x3D;
46 | uint32_t sr : 20;
47 | };
48 |
49 | struct PWM_AUTO_t {
50 | constexpr static uint8_t address = 0x72;
51 | union {
52 | uint32_t sr : 24;
53 | struct {
54 | uint8_t pwm_ofs_auto : 8,
55 | : 8,
56 | pwm_grad_auto : 8;
57 | };
58 | };
59 | };
60 |
61 | #pragma pack(pop)
62 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/units/M149.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
26 |
27 | #include "../gcode.h"
28 |
29 | /**
30 | * M149: Set temperature units
31 | */
32 | void GcodeSuite::M149() {
33 | if (parser.seenval('C')) parser.set_input_temp_units(TEMPUNIT_C);
34 | else if (parser.seenval('K')) parser.set_input_temp_units(TEMPUNIT_K);
35 | else if (parser.seenval('F')) parser.set_input_temp_units(TEMPUNIT_F);
36 | }
37 |
38 | #endif // TEMPERATURE_UNITS_SUPPORT
39 |
--------------------------------------------------------------------------------
/source/framework/cores/flash.h:
--------------------------------------------------------------------------------
1 | #ifndef FLASH_H
2 | #define FLASH_H
3 |
4 |
5 | #include
6 |
7 | #include "hc32_ddl.h"
8 |
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 |
15 | // use 256k to improve compatibility
16 | // 32 sectors, 8k bytes per sector
17 | #define FLASH_SECTOR_TOTAL 32
18 | #define FLASH_SECTOR_SIZE ((uint32_t)(8*1024U))
19 | #define FLASH_ALL_START 0
20 | #define FLASH_ALL_END ((uint32_t)0x0003FFFFU)
21 |
22 | // use last sector to emulate eeprom
23 | #define FLASH_EEPROM_BASE ((uint32_t)0x0007E000U)
24 |
25 |
26 | #define FLASH_BASE ((uint32_t)0x0007E000U) /*!< FLASH base address in the alias region */
27 |
28 | // just use 1k bytes, not a full sector
29 | #define EEPROM_SIZE 1024
30 |
31 |
32 | // power outage
33 | #define FLASH_OUTAGE_DATA_ADDR ((uint32_t)0x0007C000U)
34 |
35 |
36 |
37 | namespace Intflash {
38 | void eeprom_buffer_fill();
39 | uint8_t eeprom_buffered_read_byte(const uint32_t pos);
40 | void eeprom_buffered_write_byte(uint32_t pos, uint8_t value);
41 | uint8_t eeprom_read_byte(const uint32_t pos);
42 | void eeprom_write_byte(uint32_t pos, uint8_t value);
43 | void eeprom_buffer_flush();
44 | uint32_t Flash_Updata(uint32_t flashAddr, const void * dataBuf, uint16_t length);
45 | en_result_t FlashErasePage(uint32_t u32Addr);
46 | }
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 |
52 | #endif
53 |
54 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/stats/M31.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../core/serial.h"
25 | #include "../../module/printcounter.h"
26 | #include "../../libs/duration_t.h"
27 | #include "../../lcd/marlinui.h"
28 |
29 | /**
30 | * M31: Get the time since the start of SD Print (or last M109)
31 | */
32 | void GcodeSuite::M31() {
33 | char buffer[22];
34 | duration_t(print_job_timer.duration()).toString(buffer);
35 |
36 | ui.set_status(buffer);
37 |
38 | SERIAL_ECHO_START();
39 | SERIAL_ECHOLNPAIR("Print time: ", buffer);
40 | }
41 |
--------------------------------------------------------------------------------
/source/framework/TMCStepper/source/DRVCONF.cpp:
--------------------------------------------------------------------------------
1 | #include "TMCStepper.h"
2 | #include "TMC_MACROS.h"
3 |
4 | //#define SET_REG(SETTING) DRVCONF_register.SETTING = B; write(DRVCONF_register.address, DRVCONF_register.sr)
5 | //#define GET_REG(SETTING) return DRVCONF_register.SETTING;
6 | //
7 | //uint32_t TMC2660Stepper::DRVCONF() { return DRVCONF_register.sr; }
8 | //void TMC2660Stepper::DRVCONF(uint32_t data) {
9 | // DRVCONF_register.sr = data;
10 | // write(DRVCONF_register.address, DRVCONF_register.sr);
11 | //}
12 | //
13 | //void TMC2660Stepper::tst(bool B) { SET_REG(tst); }
14 | //void TMC2660Stepper::slph(uint8_t B) { SET_REG(slph); }
15 | //void TMC2660Stepper::slpl(uint8_t B) { SET_REG(slpl); }
16 | //void TMC2660Stepper::diss2g(bool B) { SET_REG(diss2g);}
17 | //void TMC2660Stepper::ts2g(uint8_t B) { SET_REG(ts2g); }
18 | //void TMC2660Stepper::sdoff(bool B) { SET_REG(sdoff); }
19 | //void TMC2660Stepper::vsense(bool B) { SET_REG(vsense);}
20 | //void TMC2660Stepper::rdsel(uint8_t B) { SET_REG(rdsel); }
21 | //
22 | //bool TMC2660Stepper::tst() { GET_REG(tst); }
23 | //uint8_t TMC2660Stepper::slph() { GET_REG(slph); }
24 | //uint8_t TMC2660Stepper::slpl() { GET_REG(slpl); }
25 | //bool TMC2660Stepper::diss2g() { GET_REG(diss2g); }
26 | //uint8_t TMC2660Stepper::ts2g() { GET_REG(ts2g); }
27 | //bool TMC2660Stepper::sdoff() { GET_REG(sdoff); }
28 | //bool TMC2660Stepper::vsense() { GET_REG(vsense); }
29 | //uint8_t TMC2660Stepper::rdsel() { GET_REG(rdsel); }
30 |
--------------------------------------------------------------------------------
/source/board/bsp_sdio.h:
--------------------------------------------------------------------------------
1 | #ifndef __BSP_SDIO_H__
2 | #define __BSP_SDIO_H__
3 |
4 |
5 | #include "hc32_ddl.h"
6 | #include "sd_card.h"
7 |
8 |
9 | #define SDIOC_CD_PORT (PortA)
10 | #define SDIOC_CD_PIN (Pin10)
11 |
12 | #define SDIOC_D0_PORT (PortC)
13 | #define SDIOC_D0_PIN (Pin08)
14 |
15 | #define SDIOC_D1_PORT (PortC)
16 | #define SDIOC_D1_PIN (Pin09)
17 |
18 | #define SDIOC_D2_PORT (PortC)
19 | #define SDIOC_D2_PIN (Pin10)
20 |
21 | #define SDIOC_D3_PORT (PortC)
22 | #define SDIOC_D3_PIN (Pin11)
23 |
24 | #define SDIOC_CK_PORT (PortC)
25 | #define SDIOC_CK_PIN (Pin12)
26 |
27 | #define SDIOC_CMD_PORT (PortD)
28 | #define SDIOC_CMD_PIN (Pin02)
29 |
30 |
31 | /* SD sector && count */
32 | #define SD_SECTOR_START (0u)
33 | #define SD_SECTOR_COUNT (4u)
34 |
35 | /* SDIOC unit */
36 | #define SDIOC_UNIT (M4_SDIOC1)
37 |
38 |
39 | extern stc_sd_handle_t stcSdhandle;
40 |
41 |
42 | void hal_sdio_init();
43 |
44 | void sdio_controller_init();
45 |
46 | static en_result_t SdiocInitPins(void);
47 | uint8_t sdio_write(uint32_t blockAddress, const uint8_t *data);
48 | uint8_t sdio_read(uint32_t blockAddress, uint8_t *data);
49 |
50 | void sdio_raw_test();
51 |
52 |
53 |
54 | #endif
55 |
56 |
--------------------------------------------------------------------------------
/source/arduino/Printable.h:
--------------------------------------------------------------------------------
1 | /*
2 | Printable.h - Interface class that allows printing of complex types
3 | Copyright (c) 2011 Adrian McEwen. All right reserved.
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef Printable_h
21 | #define Printable_h
22 |
23 | #include
24 |
25 | class Print;
26 |
27 | /** The Printable class provides a way for new classes to allow themselves to be printed.
28 | By deriving from Printable and implementing the printTo method, it will then be possible
29 | for users to print out instances of this class by passing them into the usual
30 | Print::print and Print::println methods.
31 | */
32 |
33 | class Printable
34 | {
35 | public:
36 | virtual size_t printTo(Print& p) const = 0;
37 | };
38 |
39 | #endif
40 |
41 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/feature/pause/G27.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 |
24 | #include "../../../inc/MarlinConfig.h"
25 |
26 | #if ENABLED(NOZZLE_PARK_FEATURE)
27 |
28 | #include "../../gcode.h"
29 | #include "../../../libs/nozzle.h"
30 | #include "../../../module/motion.h"
31 |
32 | /**
33 | * G27: Park the nozzle
34 | */
35 | void GcodeSuite::G27() {
36 | // Don't allow nozzle parking without homing first
37 | constexpr xyz_pos_t park_point = NOZZLE_PARK_POINT;
38 | if (homing_needed_error()) return;
39 | nozzle.park(parser.ushortval('P'),park_point);
40 | }
41 |
42 | #endif // NOZZLE_PARK_FEATURE
43 |
--------------------------------------------------------------------------------
/indexed-image-array/src/main.rs:
--------------------------------------------------------------------------------
1 | use std::collections::HashMap;
2 |
3 | fn main() {
4 | let img = image::open("input.png").unwrap();
5 |
6 | assert!(img.width() == 320);
7 | assert!(img.height() == 240);
8 |
9 | let bytes = img.to_rgb8();
10 |
11 | let mut palette: HashMap = HashMap::new();
12 | let mut index_map: Vec = Vec::new();
13 |
14 | let mut idx: u32 = 0;
15 | for pixel in bytes.pixels() {
16 | let color_idx = palette
17 | .entry(u32::from_be_bytes([pixel.0[2], pixel.0[1], pixel.0[0], 0x0]))
18 | .or_insert_with(|| {
19 | let tmp = idx;
20 | idx += 1;
21 | tmp
22 | });
23 | index_map.push(*color_idx);
24 | }
25 |
26 | const PALETTE_TMPL: &str = "const uint32_t GUI_COLOR_Colors4[%0] __attribute((aligned (4))) = { %1 };";
27 | const INDICES_TMPL: &str = "const unsigned char _ac[76800] __attribute((aligned (4))) = { %0 };";
28 |
29 | let mut palette = palette.iter().map(|(a, b)| (*a, *b)).collect::>();
30 | palette.sort_by(|a, b| a.1.cmp(&b.1));
31 | let palette = palette
32 | .into_iter()
33 | .map(|x| x.0)
34 | .map(|x| format!("{x:#X}")[0..6 + 2].to_owned())
35 | .collect::>();
36 |
37 | println!("// Palette");
38 | println!(
39 | "{}",
40 | PALETTE_TMPL
41 | .replace("%0", &palette.len().to_string())
42 | .replace("%1", &palette.join(", "))
43 | );
44 | println!();
45 | println!("// Indices");
46 | println!(
47 | "{}",
48 | INDICES_TMPL.replace("%0", &index_map.iter().map(u32::to_string).collect::>().join(", "))
49 | );
50 | }
51 |
--------------------------------------------------------------------------------
/source/board/bsp_timer.h:
--------------------------------------------------------------------------------
1 | #ifndef __BSP_TIMER_H__
2 | #define __BSP_TIMER_H__
3 |
4 |
5 | #include "hc32_ddl.h"
6 |
7 |
8 | #define TMR_UNIT (M4_TMR02)
9 | #define TMR_INI_GCMA (INT_TMR02_GCMA)
10 | #define TMR_INI_GCMB (INT_TMR02_GCMB)
11 |
12 |
13 | #define TMR_SSERIAL_UNIT (M4_TMR02)
14 | #define TMR_SSERIAL_CH (Tim0_ChannelB)
15 |
16 |
17 | #define TMR_SSERIAL_STOP() TIMER0_Cmd(TMR_SSERIAL_UNIT, TMR_SSERIAL_CH, Disable)
18 | #define TMR_SSERIAL_RESUM() TIMER0_Cmd(TMR_SSERIAL_UNIT, TMR_SSERIAL_CH, Enable)
19 |
20 |
21 | uint32_t get_pclk1Freq(void);
22 |
23 | void timer02A_init(void);
24 | void timer02B_init(void);
25 |
26 | void timer01A_enable(void);
27 | void timer01A_disable(void);
28 | void timer01B_init(void);
29 | void timer01B_set_overflow(uint16_t ms);
30 | void timer01B_enable(void);
31 | void timer01B_disable(void);
32 |
33 | void timer41_init(void);
34 |
35 | extern void timer41_zero_match_irq_cb(void);
36 | extern void timer42_zero_match_irq_cb(void);
37 | void timer42_init(void);
38 | void timer42_init_check(void);
39 | void timer42_set_frequency(const uint32_t frequency);
40 | void timer42_irq_ctrl(en_functional_state_t state);
41 | bool timer42_irq_get(void);
42 | bool timer42_set_compare(const uint16_t compare);
43 | uint16_t timer42_get_count(void);
44 |
45 |
46 | //********************use for bltouch*********************
47 | void timerA2_bltouch_init(void);
48 | void servo_set_compare(uint16_t duty_cycle); //
49 | //**********************end bltouch***********
50 | #endif
51 |
52 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_1010.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define REVERSE_TEMP_SENSOR_RANGE_1010 1
25 |
26 | // Pt1000 with 1k0 pullup
27 | const temp_entry_t temptable_1010[] PROGMEM = {
28 | PtLine( 0, 1000, 1000),
29 | PtLine( 25, 1000, 1000),
30 | PtLine( 50, 1000, 1000),
31 | PtLine( 75, 1000, 1000),
32 | PtLine(100, 1000, 1000),
33 | PtLine(125, 1000, 1000),
34 | PtLine(150, 1000, 1000),
35 | PtLine(175, 1000, 1000),
36 | PtLine(200, 1000, 1000),
37 | PtLine(225, 1000, 1000),
38 | PtLine(250, 1000, 1000),
39 | PtLine(275, 1000, 1000),
40 | PtLine(300, 1000, 1000)
41 | };
42 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_1047.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define REVERSE_TEMP_SENSOR_RANGE_1047 1
25 |
26 | // Pt1000 with 4k7 pullup
27 | const temp_entry_t temptable_1047[] PROGMEM = {
28 | // only a few values are needed as the curve is very flat
29 | PtLine( 0, 1000, 4700),
30 | PtLine( 50, 1000, 4700),
31 | PtLine(100, 1000, 4700),
32 | PtLine(150, 1000, 4700),
33 | PtLine(200, 1000, 4700),
34 | PtLine(250, 1000, 4700),
35 | PtLine(300, 1000, 4700),
36 | PtLine(350, 1000, 4700),
37 | PtLine(400, 1000, 4700),
38 | PtLine(450, 1000, 4700),
39 | PtLine(500, 1000, 4700)
40 | };
41 |
--------------------------------------------------------------------------------
/source/Marlin/src/feature/e_parser.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | /**
24 | * e_parser.cpp - Intercept special commands directly in the serial stream
25 | */
26 |
27 | #include "../inc/MarlinConfigPre.h"
28 |
29 | #if ENABLED(EMERGENCY_PARSER)
30 |
31 | #include "e_parser.h"
32 |
33 | // Static data members
34 | bool EmergencyParser::killed_by_M112, // = false
35 | EmergencyParser::quickstop_by_M410,
36 | EmergencyParser::enabled;
37 |
38 | #if ENABLED(HOST_PROMPT_SUPPORT)
39 | uint8_t EmergencyParser::M876_reason; // = 0
40 | #endif
41 |
42 | // Global instance
43 | EmergencyParser emergency_parser;
44 |
45 | #endif // EMERGENCY_PARSER
46 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M34.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M34: Set SD Card Sorting Options
32 | */
33 | void GcodeSuite::M34() {
34 | if (parser.seen('S')) card.setSortOn(parser.value_bool());
35 | if (parser.seenval('F')) {
36 | const int v = parser.value_long();
37 | card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0);
38 | }
39 | //if (parser.seen('R')) card.setSortReverse(parser.value_bool());
40 | }
41 |
42 | #endif // SDCARD_SORT_ALPHA && SDSORT_GCODE
43 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/ui_320x240.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define MARLIN_LOGO_FULL_SIZE MarlinLogo320x240x16
25 |
26 | #define TFT_STATUS_TOP_Y 0
27 | #define TFT_TOP_LINE_Y 2
28 |
29 | #define MENU_TEXT_X_OFFSET 10
30 | #define MENU_TEXT_Y_OFFSET 7
31 |
32 | #define MENU_ITEM_ICON_X 0
33 | #define MENU_ITEM_ICON_Y 0
34 | #define MENU_ITEM_ICON_SPACE 32
35 |
36 | #define MENU_ITEM_HEIGHT 32
37 | #define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2)
38 |
39 | #define MENU_FONT_NAME ISO10646_CN
40 | //#define SYMBOLS_FONT_NAME Helvetica14_symbols
41 |
42 | #include "ui_common.h"
43 |
--------------------------------------------------------------------------------
/source/Marlin/src/sd/Sd2Card_sdio.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include "../inc/MarlinConfig.h"
25 |
26 | #if ENABLED(SDIO_SUPPORT)
27 |
28 | bool SDIO_Init();
29 | bool SDIO_ReadBlock(uint32_t block, uint8_t *dst);
30 | bool SDIO_WriteBlock(uint32_t block, const uint8_t *src);
31 |
32 | class Sd2Card {
33 | public:
34 | bool init(uint8_t sckRateID = 0, uint8_t chipSelectPin = 0) { return SDIO_Init(); }
35 | bool readBlock(uint32_t block, uint8_t *dst) { return SDIO_ReadBlock(block, dst); }
36 | bool writeBlock(uint32_t block, const uint8_t *src) { return SDIO_WriteBlock(block, src); }
37 | };
38 |
39 | #endif // SDIO_SUPPORT
40 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/lcd/M300.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if HAS_BUZZER
26 |
27 | #include "../gcode.h"
28 |
29 | #include "../../lcd/marlinui.h" // i2c-based BUZZ
30 | #include "../../libs/buzzer.h" // Buzzer, if possible
31 |
32 | /**
33 | * M300: Play beep sound S P
34 | */
35 | void GcodeSuite::M300() {
36 | uint16_t const frequency = parser.ushortval('S', 260);
37 | uint16_t duration = parser.ushortval('P', 1000);
38 |
39 | // Limits the tone duration to 0-5 seconds.
40 | NOMORE(duration, 5000U);
41 |
42 | BUZZ(duration, frequency);
43 | }
44 |
45 | #endif // HAS_BUZZER
46 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/lcd/M995.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(TOUCH_SCREEN_CALIBRATION)
26 |
27 | #include "../gcode.h"
28 |
29 | #if ENABLED(TFT_LVGL_UI)
30 | #include "../../lcd/extui/lib/mks_ui/draw_touch_calibration.h"
31 | #else
32 | #include "../../lcd/menu/menu.h"
33 | #endif
34 |
35 | /**
36 | * M995: Touch screen calibration for TFT display
37 | */
38 | void GcodeSuite::M995() {
39 |
40 | #if ENABLED(TFT_LVGL_UI)
41 | lv_draw_touch_calibration_screen();
42 | #else
43 | ui.goto_screen(touch_screen_calibration);
44 | #endif
45 |
46 | }
47 |
48 | #endif // TOUCH_SCREEN_CALIBRATION
49 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M23.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 | #include "../../lcd/marlinui.h"
30 |
31 | /**
32 | * M23: Open a file
33 | *
34 | * The path is relative to the root directory
35 | */
36 | void GcodeSuite::M23() {
37 | // Simplify3D includes the size, so zero out all spaces (#7227)
38 | for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
39 | card.openFileRead(parser.string_arg);
40 |
41 | TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0));
42 | }
43 |
44 | #endif // SDSUPPORT
45 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/probe/M401_M402.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if HAS_BED_PROBE
26 |
27 | #include "../gcode.h"
28 | #include "../../module/motion.h"
29 | #include "../../module/probe.h"
30 |
31 | /**
32 | * M401: Deploy and activate the Z probe
33 | */
34 | void GcodeSuite::M401() {
35 | probe.deploy();
36 | TERN_(PROBE_TARE, probe.tare());
37 | report_current_position();
38 | }
39 |
40 | /**
41 | * M402: Deactivate and stow the Z probe
42 | */
43 | void GcodeSuite::M402() {
44 | probe.stow();
45 | probe.move_z_after_probing();
46 | report_current_position();
47 | }
48 |
49 | #endif // HAS_BED_PROBE
50 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M33.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M33: Get the long full path of a file or folder
32 | *
33 | * Parameters:
34 | * Case-insensitive DOS-style path to a file or folder
35 | *
36 | * Example:
37 | * M33 miscel~1/armchair/armcha~1.gco
38 | *
39 | * Output:
40 | * /Miscellaneous/Armchair/Armchair.gcode
41 | */
42 | void GcodeSuite::M33() {
43 |
44 | card.printLongPath(parser.string_arg);
45 |
46 | }
47 |
48 | #endif // LONG_FILENAME_HOST_SUPPORT
49 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/host/M113.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(HOST_KEEPALIVE_FEATURE)
26 |
27 | #include "../gcode.h"
28 |
29 | /**
30 | * M113: Get or set Host Keepalive interval (0 to disable)
31 | *
32 | * S Optional. Set the keepalive interval.
33 | */
34 | void GcodeSuite::M113() {
35 | if (parser.seenval('S')) {
36 | host_keepalive_interval = parser.value_byte();
37 | NOMORE(host_keepalive_interval, 60);
38 | }
39 | else {
40 | SERIAL_ECHO_START();
41 | SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval);
42 | }
43 | }
44 |
45 | #endif // HOST_KEEPALIVE_FEATURE
46 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/ui_1024x600.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define MARLIN_LOGO_FULL_SIZE MarlinLogo480x320x16
25 |
26 | #include "ui_common.h"
27 |
28 | #define TFT_STATUS_TOP_Y 4
29 | #define TFT_TOP_LINE_Y 4
30 |
31 | #define MENU_TEXT_X_OFFSET 16
32 | #define MENU_TEXT_Y_OFFSET 7
33 |
34 | #define MENU_ITEM_ICON_X 5
35 | #define MENU_ITEM_ICON_Y 5
36 | #define MENU_ITEM_ICON_SPACE 42
37 |
38 | #define MENU_FONT_NAME Helvetica18
39 | #define SYMBOLS_FONT_NAME Helvetica18_symbols
40 | #define MENU_ITEM_HEIGHT 43
41 | #define FONT_LINE_HEIGHT 34
42 |
43 | #define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2)
44 |
--------------------------------------------------------------------------------
/source/framework/cores/Tone.cpp:
--------------------------------------------------------------------------------
1 | #include "tone.h"
2 | #include "timers.h"
3 | #include "bsp_timer.h"
4 | #include "bsp_pwm.h"
5 | #include "utility.h"
6 | #include "dgus_Tunes.h"
7 | #define TIMRE_MAX_DURATION_MS 671
8 |
9 |
10 | static volatile uint32_t duration_cnt = 0;
11 | static volatile uint16_t duration_spare = 0;
12 |
13 |
14 | void tone(uint8_t _pin, uint16_t frequency, uint32_t duration)
15 | {
16 | duration_cnt = duration / TIMRE_MAX_DURATION_MS;
17 | duration_spare = duration % TIMRE_MAX_DURATION_MS;
18 |
19 | if(duration_cnt) {
20 | timer01B_set_overflow(TIMRE_MAX_DURATION_MS);
21 | } else {
22 | timer01B_set_overflow(duration);
23 | }
24 | beep_pwm_set_frequency(frequency, 50);
25 | }
26 |
27 | void AC_PlayTune(uint8_t beeperPin, const uint16_t *tune, uint8_t speed=1) {
28 | uint8_t pos = 1;
29 | uint16_t wholenotelen = tune[0] / speed;
30 | do {
31 | uint16_t freq = tune[pos];
32 | uint16_t notelen = wholenotelen / tune[pos + 1];
33 |
34 | tone(beeperPin, freq, notelen);
35 | safe_delay(notelen);
36 | pos += 2;
37 |
38 | if (pos >= MAX_TUNE_LENGTH) break;
39 | } while (tune[pos] != n_END);
40 | }
41 |
42 |
43 | void noTone(uint8_t _pin, bool destruct)
44 | {
45 |
46 | }
47 |
48 | HAL_TONE_TIMER_ISR()
49 | {
50 | if(duration_cnt) {
51 | duration_cnt--;
52 | } else if(duration_spare) {
53 | timer01B_set_overflow(duration_spare);
54 | duration_spare = 0;
55 | } else {
56 | beep_pwm_stop();
57 | timer01B_disable();
58 | }
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/source/Marlin/src/libs/hex_print.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include
25 |
26 | //
27 | // Utility functions to create and print hex strings as nybble, byte, and word.
28 | //
29 |
30 | FORCE_INLINE char hex_nybble(const uint8_t n) {
31 | return (n & 0xF) + ((n & 0xF) < 10 ? '0' : 'A' - 10);
32 | }
33 | char* hex_byte(const uint8_t b);
34 | char* hex_word(const uint16_t w);
35 | char* hex_address(const void * const w);
36 |
37 | void print_hex_nybble(const uint8_t n);
38 | void print_hex_byte(const uint8_t b);
39 | void print_hex_word(const uint16_t w);
40 | void print_hex_address(const void * const w);
41 | void print_hex_long(const uint32_t w, const char delimiter);
42 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/timers.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "../../inc/MarlinConfig.h"
3 | #include "HAL.h"
4 | #include "timers.h"
5 |
6 | static hal_timer_t compare_hal=0x0;
7 |
8 | void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
9 | switch (timer_num) {
10 | case STEP_TIMER_NUM: setup_step_tim(frequency);break;
11 | case TEMP_TIMER_NUM: setup_temp_tim(frequency);break;
12 | }
13 | }
14 |
15 | void HAL_timer_enable_interrupt(const uint8_t timer_num) {
16 | switch (timer_num) {
17 | case STEP_TIMER_NUM: ENABLE_STEPPER_DRIVER_INTERRUPT(); break;
18 | case TEMP_TIMER_NUM: ENABLE_TEMPERATURE_INTERRUPT(); break;
19 | }
20 | }
21 |
22 | void HAL_timer_disable_interrupt(const uint8_t timer_num) {
23 | switch (timer_num) {
24 | case STEP_TIMER_NUM: DISABLE_STEPPER_DRIVER_INTERRUPT(); break;
25 | case TEMP_TIMER_NUM: DISABLE_TEMPERATURE_INTERRUPT(); break;
26 | }
27 | }
28 |
29 | bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
30 | return timer_irq_enabled(TMR_UNIT,timer_num);
31 | }
32 |
33 | void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
34 | // if(compare_hal != compare){
35 | // compare_hal = compare;
36 | // en_functional_state_t state_t = (timer_num==STEP_TIMER_NUM)?Disable:Enable;
37 | // timer_set_compare(timer_num, compare, state_t);
38 | // }
39 |
40 | switch (timer_num) {
41 | case STEP_TIMER_NUM:
42 | timer_set_compare(timer_num, compare);
43 | break;
44 |
45 | case TEMP_TIMER_NUM:
46 |
47 | break;
48 | }
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/source/Marlin/src/core/debug_section.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include "serial.h"
25 | #include "../module/motion.h"
26 |
27 | class SectionLog {
28 | public:
29 | SectionLog(PGM_P const msg=nullptr, bool inbug=true) {
30 | the_msg = msg;
31 | if ((debug = inbug)>0) echo_msg(PSTR(">>>"));
32 | }
33 |
34 | ~SectionLog() { if (debug) echo_msg(PSTR("<<<")); }
35 |
36 | private:
37 | PGM_P the_msg;
38 | bool debug;
39 |
40 | void echo_msg(PGM_P const pre) {
41 | serialprintPGM(pre);
42 | if (the_msg) {
43 | SERIAL_CHAR(' ');
44 | serialprintPGM(the_msg);
45 | }
46 | SERIAL_CHAR(' ');
47 | print_xyz(current_position);
48 | }
49 | };
50 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/motion/G4.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../module/stepper.h"
25 | #include "../../lcd/marlinui.h"
26 |
27 | /**
28 | * G4: Dwell S or P
29 | */
30 | void GcodeSuite::G4() {
31 | millis_t dwell_ms = 0;
32 |
33 | if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait
34 | if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait
35 |
36 | planner.synchronize();
37 | #if ENABLED(NANODLP_Z_SYNC)
38 | SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
39 | #endif
40 |
41 | if (!ui.has_status()) LCD_MESSAGEPGM(MSG_DWELL);
42 |
43 | dwell(dwell_ms);
44 | }
45 |
--------------------------------------------------------------------------------
/source/framework/cores/Tone.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2011 Arduino. All right reserved.
3 |
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Lesser General Public
6 | License as published by the Free Software Foundation; either
7 | version 2.1 of the License, or (at your option) any later version.
8 |
9 | This library is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 | See the GNU Lesser General Public License for more details.
13 |
14 | You should have received a copy of the GNU Lesser General Public
15 | License along with this library; if not, write to the Free Software
16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef _WIRING_TONE_
20 | #define _WIRING_TONE_
21 |
22 |
23 | #include
24 |
25 |
26 | #ifdef __cplusplus
27 | /*
28 | * \brief Generate a tone to a pin.
29 | *
30 | * \param _pin
31 | * \param frequency Tone frequency (in hertz)
32 | * \param duration Tone duration (in milliseconds)
33 | */
34 | extern void tone(uint8_t _pin, uint16_t frequency, uint32_t duration = 0);
35 |
36 | /*
37 | * \brief Stop tone generation on pin.
38 | *
39 | * \param _pin
40 | */
41 | extern void noTone(uint8_t _pin, bool destruct = false);
42 | extern void AC_PlayTune(uint8_t beeperPin, const uint16_t *tune, uint8_t speed);
43 | // extern void HAL_TONE_TIMER_ISR(void);
44 |
45 | #endif
46 |
47 | #endif /* _WIRING_TONE_ */
48 |
--------------------------------------------------------------------------------
/source/framework/cores/bits.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * The MIT License
3 | *
4 | * Copyright (c) 2010 LeafLabs, LLC.
5 | *
6 | * Permission is hereby granted, free of charge, to any person
7 | * obtaining a copy of this software and associated documentation
8 | * files (the "Software"), to deal in the Software without
9 | * restriction, including without limitation the rights to use, copy,
10 | * modify, merge, publish, distribute, sublicense, and/or sell copies
11 | * of the Software, and to permit persons to whom the Software is
12 | * furnished to do so, subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be
15 | * included in all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | * SOFTWARE.
25 | *****************************************************************************/
26 |
27 | /* Note: Use of this header file is deprecated. Use bit_constants.h
28 | instead. */
29 |
30 | #ifndef _WIRISH_BITS_H_
31 | #define _WIRISH_BITS_H_
32 |
33 | #include "bit_constants.h"
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_8.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // R25 = 100 kOhm, beta25 = 3950 K, 10 kOhm pull-up, NTCS0603E3104FHT
25 | const temp_entry_t temptable_8[] PROGMEM = {
26 | { OV( 1), 704 },
27 | { OV( 54), 216 },
28 | { OV( 107), 175 },
29 | { OV( 160), 152 },
30 | { OV( 213), 137 },
31 | { OV( 266), 125 },
32 | { OV( 319), 115 },
33 | { OV( 372), 106 },
34 | { OV( 425), 99 },
35 | { OV( 478), 91 },
36 | { OV( 531), 85 },
37 | { OV( 584), 78 },
38 | { OV( 637), 71 },
39 | { OV( 690), 65 },
40 | { OV( 743), 58 },
41 | { OV( 796), 50 },
42 | { OV( 849), 42 },
43 | { OV( 902), 31 },
44 | { OV( 955), 17 },
45 | { OV(1008), 0 }
46 | };
47 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_4.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // R25 = 10 kOhm, beta25 = 3950 K, 4.7 kOhm pull-up, Generic 10k thermistor
25 | const temp_entry_t temptable_4[] PROGMEM = {
26 | { OV( 1), 430 },
27 | { OV( 54), 137 },
28 | { OV( 107), 107 },
29 | { OV( 160), 91 },
30 | { OV( 213), 80 },
31 | { OV( 266), 71 },
32 | { OV( 319), 64 },
33 | { OV( 372), 57 },
34 | { OV( 425), 51 },
35 | { OV( 478), 46 },
36 | { OV( 531), 41 },
37 | { OV( 584), 35 },
38 | { OV( 637), 30 },
39 | { OV( 690), 25 },
40 | { OV( 743), 20 },
41 | { OV( 796), 14 },
42 | { OV( 849), 7 },
43 | { OV( 902), 0 },
44 | { OV( 955), -11 },
45 | { OV(1008), -35 }
46 | };
47 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/config/M221.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../module/planner.h"
25 |
26 | #if EXTRUDERS
27 |
28 | /**
29 | * M221: Set extrusion percentage (M221 T0 S95)
30 | */
31 | void GcodeSuite::M221() {
32 |
33 | const int8_t target_extruder = get_target_extruder_from_command();
34 | if (target_extruder < 0) return;
35 |
36 | if (parser.seenval('S'))
37 | planner.set_flow(target_extruder, parser.value_int());
38 | else {
39 | SERIAL_ECHO_START();
40 | SERIAL_CHAR('E', '0' + target_extruder);
41 | SERIAL_ECHOPAIR(" Flow: ", planner.flow_percentage[target_extruder]);
42 | SERIAL_CHAR('%');
43 | SERIAL_EOL();
44 | }
45 | }
46 |
47 | #endif // EXTRUDERS
48 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/watchdog.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | /**
25 | * HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
26 | */
27 |
28 | #include "../cores/iwdg.h"
29 |
30 | /**
31 | * The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
32 | * 625 reload value (counts down to 0)
33 | * use 1250 for 8 seconds
34 | */
35 | #define STM32F1_WD_RELOAD 625
36 |
37 | // Arduino STM32F1 core now has watchdog support
38 |
39 | // Initialize watchdog with a 4 second countdown time
40 | void watchdog_init();
41 |
42 | // Reset watchdog. MUST be called at least every 4 seconds after the
43 | // first watchdog_init or STM32F1 will reset.
44 | void HAL_watchdog_refresh();
45 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/menu/menu_game.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfigPre.h"
24 |
25 | #if HAS_GAME_MENU
26 |
27 | #include "menu_item.h"
28 | #include "game/game.h"
29 |
30 | void menu_game() {
31 | START_MENU();
32 | BACK_ITEM(TERN(LCD_INFO_MENU, MSG_INFO_MENU, MSG_MAIN));
33 | #if ENABLED(MARLIN_BRICKOUT)
34 | SUBMENU(MSG_BRICKOUT, brickout.enter_game);
35 | #endif
36 | #if ENABLED(MARLIN_INVADERS)
37 | SUBMENU(MSG_INVADERS, invaders.enter_game);
38 | #endif
39 | #if ENABLED(MARLIN_SNAKE)
40 | SUBMENU(MSG_SNAKE, snake.enter_game);
41 | #endif
42 | #if ENABLED(MARLIN_MAZE)
43 | SUBMENU(MSG_MAZE, maze.enter_game);
44 | #endif
45 | END_MENU();
46 | }
47 |
48 | #endif // HAS_GAME_MENU
49 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/temp/M105.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 | #include "../../module/temperature.h"
25 |
26 | /**
27 | * M105: Read hot end and bed temperature
28 | */
29 | void GcodeSuite::M105() {
30 |
31 | const int8_t target_extruder = get_target_extruder_from_command();
32 | if (target_extruder < 0) return;
33 |
34 | SERIAL_ECHOPGM(STR_OK);
35 |
36 | #if HAS_TEMP_SENSOR
37 |
38 | thermalManager.print_heater_states(target_extruder
39 | #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
40 | , parser.boolval('R')
41 | #endif
42 | );
43 |
44 | SERIAL_EOL();
45 |
46 | #else
47 |
48 | SERIAL_ECHOLNPGM(" T:0"); // Some hosts send M105 to test the serial connection
49 |
50 | #endif
51 | }
52 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/images/slider_8x16x4.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../../inc/MarlinConfigPre.h"
24 |
25 | #if HAS_GRAPHICAL_TFT
26 | #pragma pack(4)
27 | extern const uint8_t slider_8x16x4[64] __attribute((aligned (4)))= {
28 | 0x88, 0xFF, 0xFF, 0x88,
29 | 0x8F, 0xFF, 0xFF, 0xF8,
30 | 0x8F, 0xFF, 0xFF, 0xF8,
31 | 0x8F, 0xFF, 0xFF, 0xF8,
32 | 0x8F, 0xFF, 0xFF, 0xF8,
33 | 0x8F, 0xFF, 0xFF, 0xF8,
34 | 0x8F, 0xFF, 0xFF, 0xF8,
35 | 0x8F, 0xFF, 0xFF, 0xF8,
36 | 0x8F, 0xFF, 0xFF, 0xF8,
37 | 0x8F, 0xFF, 0xFF, 0xF8,
38 | 0x8F, 0xFF, 0xFF, 0xF8,
39 | 0x8F, 0xFF, 0xFF, 0xF8,
40 | 0x8F, 0xFF, 0xFF, 0xF8,
41 | 0x8F, 0xFF, 0xFF, 0xF8,
42 | 0x8F, 0xFF, 0xFF, 0xF8,
43 | 0x88, 0xFF, 0xFF, 0x88,
44 | };
45 |
46 | #endif // HAS_GRAPHICAL_TFT
47 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M999.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../gcode.h"
24 |
25 | #include "../../lcd/marlinui.h" // for lcd_reset_alert_level
26 | #include "../../MarlinCore.h" // for marlin_state
27 | #include "../queue.h" // for flush_and_request_resend
28 |
29 | /**
30 | * M999: Restart after being stopped
31 | *
32 | * Default behavior is to flush the serial buffer and request
33 | * a resend to the host starting on the last N line received.
34 | *
35 | * Sending "M999 S1" will resume printing without flushing the
36 | * existing command buffer.
37 | */
38 | void GcodeSuite::M999() {
39 | marlin_state = MF_RUNNING;
40 | ui.reset_alert_level();
41 |
42 | if (parser.boolval('S')) return;
43 |
44 | queue.flush_and_request_resend();
45 | }
46 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M27.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(SDSUPPORT)
26 |
27 | #include "../gcode.h"
28 | #include "../../sd/cardreader.h"
29 |
30 | /**
31 | * M27: Get SD Card status
32 | * OR, with 'S' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
33 | * OR, with 'C' get the current filename.
34 | */
35 | void GcodeSuite::M27() {
36 | if (parser.seen('C')) {
37 | SERIAL_ECHOPGM("Current file: ");
38 | card.printFilename();
39 | }
40 |
41 | #if ENABLED(AUTO_REPORT_SD_STATUS)
42 | else if (parser.seenval('S'))
43 | card.set_auto_report_interval(parser.value_byte());
44 | #endif
45 |
46 | else
47 | card.report_status();
48 | }
49 |
50 | #endif // SDSUPPORT
51 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/lcd/M73.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
26 |
27 | #include "../gcode.h"
28 | #include "../../lcd/marlinui.h"
29 | #include "../../sd/cardreader.h"
30 |
31 | /**
32 | * M73: Set percentage complete (for display on LCD)
33 | *
34 | * Example:
35 | * M73 P25 ; Set progress to 25%
36 | */
37 | void GcodeSuite::M73() {
38 | if (parser.seen('P'))
39 | ui.set_progress((PROGRESS_SCALE) > 1
40 | ? parser.value_float() * (PROGRESS_SCALE)
41 | : parser.value_byte()
42 | );
43 | #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
44 | if (parser.seen('R')) ui.set_remaining_time(60 * parser.value_ulong());
45 | #endif
46 | }
47 |
48 | #endif // LCD_SET_PROGRESS_MANUALLY
49 |
--------------------------------------------------------------------------------
/source/framework/cores/Arduino.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * The MIT License
3 | *
4 | * Copyright (c) 2010 LeafLabs LLC.
5 | *
6 | * Permission is hereby granted, free of charge, to any person
7 | * obtaining a copy of this software and associated documentation
8 | * files (the "Software"), to deal in the Software without
9 | * restriction, including without limitation the rights to use, copy,
10 | * modify, merge, publish, distribute, sublicense, and/or sell copies
11 | * of the Software, and to permit persons to whom the Software is
12 | * furnished to do so, subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be
15 | * included in all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | * SOFTWARE.
25 | *****************************************************************************/
26 |
27 | #ifndef _WIRISH_WPROGRAM_H_
28 | #define _WIRISH_WPROGRAM_H_
29 |
30 | #include "wirish.h"
31 |
32 | #ifdef __cplusplus
33 | extern "C"{
34 | #endif // __cplusplus
35 |
36 |
37 | int32_t random(int32_t min, int32_t max);
38 |
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif // __cplusplus
43 |
44 | #endif
45 |
46 |
--------------------------------------------------------------------------------
/source/framework/cores/Client.h:
--------------------------------------------------------------------------------
1 | /*
2 | Client.h - Base class that provides Client
3 | Copyright (c) 2011 Adrian McEwen. All right reserved.
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Lesser General Public
7 | License as published by the Free Software Foundation; either
8 | version 2.1 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Lesser General Public License for more details.
14 |
15 | You should have received a copy of the GNU Lesser General Public
16 | License along with this library; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef client_h
21 | #define client_h
22 | #include "Print.h"
23 | #include "Stream.h"
24 | #include "IPAddress.h"
25 |
26 | class Client : public Stream {
27 |
28 | public:
29 | virtual int connect(IPAddress ip, uint16_t port) =0;
30 | virtual int connect(const char *host, uint16_t port) =0;
31 | virtual size_t write(uint8_t) =0;
32 | virtual size_t write(const uint8_t *buf, size_t size) =0;
33 | virtual int available() = 0;
34 | virtual int read() = 0;
35 | virtual int read(uint8_t *buf, size_t size) = 0;
36 | virtual int peek() = 0;
37 | virtual void flush() = 0;
38 | virtual void stop() = 0;
39 | virtual uint8_t connected() = 0;
40 | virtual operator bool() = 0;
41 | protected:
42 | uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
43 | };
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/source/Marlin/src/sd/SdFile.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | /**
25 | * sd/SdFile.h
26 | *
27 | * Arduino SdFat Library
28 | * Copyright (c) 2009 by William Greiman
29 | *
30 | * This file is part of the Arduino Sd2Card Library
31 | */
32 |
33 | #include "SdBaseFile.h"
34 |
35 | #include
36 | #include
37 |
38 | /**
39 | * \class SdFile
40 | * \brief SdBaseFile with Print.
41 | */
42 | class SdFile : public SdBaseFile {
43 | public:
44 | SdFile() {}
45 | SdFile(const char* name, uint8_t oflag);
46 | #if ARDUINO >= 100
47 | size_t write(uint8_t b);
48 | #else
49 | void write(uint8_t b);
50 | #endif
51 |
52 | int16_t write(const void* buf, uint16_t nbyte);
53 | void write(const char* str);
54 | void write_P(PGM_P str);
55 | void writeln_P(PGM_P str);
56 | };
57 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_70.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // Stock BQ Hephestos 2 100k thermistor.
25 | // Created on 29/12/2017 with an ambient temperature of 20C.
26 | // ANENG AN8009 DMM with a K-type probe used for measurements.
27 |
28 | // R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, bqh2 stock thermistor
29 | const temp_entry_t temptable_70[] PROGMEM = {
30 | { OV( 18), 270 },
31 | { OV( 27), 248 },
32 | { OV( 34), 234 },
33 | { OV( 45), 220 },
34 | { OV( 61), 205 },
35 | { OV( 86), 188 },
36 | { OV( 123), 172 },
37 | { OV( 420), 110 },
38 | { OV( 590), 90 },
39 | { OV( 845), 56 },
40 | { OV( 970), 25 },
41 | { OV( 986), 20 },
42 | { OV( 994), 15 },
43 | { OV(1000), 10 },
44 | { OV(1005), 5 },
45 | { OV(1009), 0 } // safety
46 | };
47 |
--------------------------------------------------------------------------------
/source/framework/cores/wirish_math.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _WIRISH_WIRISH_MATH_H_
3 | #define _WIRISH_WIRISH_MATH_H_
4 |
5 | #include
6 | #include
7 |
8 | void randomSeed(unsigned int seed);
9 | long random(long max);
10 | long random(long min, long max);
11 | static inline int32_t map(int32_t value, int32_t fromStart, int32_t fromEnd,
12 | int32_t toStart, int32_t toEnd) {
13 | return ((int64_t)(value - fromStart) * (toEnd - toStart)) / (fromEnd - fromStart) +
14 | toStart;
15 | }
16 |
17 | //#define PI 3.1415926535897932384626433832795
18 | #define HALF_PI 1.5707963267948966192313216916398
19 | #define TWO_PI 6.283185307179586476925286766559
20 | #define DEG_TO_RAD 0.017453292519943295769236907684886
21 | #define RAD_TO_DEG 57.295779513082320876798154814105
22 |
23 |
24 | #define EULER 2.718281828459045235360287471352
25 | #define SERIAL 0x0
26 | #define DISPLAY 0x1
27 |
28 | #define min(a,b) ((a)<(b)?(a):(b))
29 | #define max(a,b) ((a)>(b)?(a):(b))
30 | #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
31 | #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
32 | #define radians(deg) ((deg)*DEG_TO_RAD)
33 | #define degrees(rad) ((rad)*RAD_TO_DEG)
34 | #define sq(x) ((x)*(x))
35 |
36 | #define abs(x) (((x) > 0) ? (x) : -(x))
37 |
38 | #ifdef math
39 | double cos(double x);
40 | double sin(double x);
41 | double tan(double x);
42 | double sqrt(double x);
43 | double pow(double x, double y);
44 | #endif
45 | extern uint16_t makeWord( uint16_t w ) ;
46 | extern uint16_t makeWord( uint8_t h, uint8_t l ) ;
47 |
48 | #define word(...) makeWord(__VA_ARGS__)
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/HAL.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include "platforms.h"
25 |
26 | #ifndef GCC_VERSION
27 | //#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
28 | #endif
29 |
30 | #include HAL_PATH(.,HAL.h)
31 |
32 | #ifdef SERIAL_PORT_2
33 | #define NUM_SERIAL 2
34 | #else
35 | #define NUM_SERIAL 1
36 | #endif
37 |
38 | #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
39 |
40 | #ifndef I2C_ADDRESS
41 | #define I2C_ADDRESS(A) uint8_t(A)
42 | #endif
43 |
44 | // Needed for AVR sprintf_P PROGMEM extension
45 | #ifndef S_FMT
46 | #define S_FMT "%s"
47 | #endif
48 |
49 | // String helper
50 | #ifndef PGMSTR
51 | #define PGMSTR(NAM,STR) const char NAM[] = STR
52 | #endif
53 |
54 | inline void watchdog_refresh() {
55 | TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
56 | }
57 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M211.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfigPre.h"
24 |
25 | #if HAS_SOFTWARE_ENDSTOPS
26 |
27 | #include "../gcode.h"
28 | #include "../../module/motion.h"
29 |
30 | /**
31 | * M211: Enable, Disable, and/or Report software endstops
32 | *
33 | * Usage: M211 S1 to enable, M211 S0 to disable, M211 alone for report
34 | */
35 | void GcodeSuite::M211() {
36 | const xyz_pos_t l_soft_min = soft_endstop.min,
37 | l_soft_max = soft_endstop.max;
38 | SERIAL_ECHO_START();
39 | SERIAL_ECHOPGM(STR_SOFT_ENDSTOPS);
40 | if (parser.seen('S')) soft_endstop._enabled = parser.value_bool();
41 | serialprint_onoff(soft_endstop._enabled);
42 | print_xyz(l_soft_min, PSTR(STR_SOFT_MIN), PSTR(" "));
43 | print_xyz(l_soft_max, PSTR(STR_SOFT_MAX));
44 | }
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/source/framework/cores/pgmspace.h:
--------------------------------------------------------------------------------
1 | #ifndef __PGMSPACE_H_
2 | #define __PGMSPACE_H_ 1
3 |
4 | #include
5 |
6 | #define PROGMEM
7 | #define PGM_P const char *
8 | #define PSTR(str) (str)
9 |
10 | #define _SFR_BYTE(n) (n)
11 |
12 | typedef void prog_void;
13 | typedef char prog_char;
14 | typedef unsigned char prog_uchar;
15 | typedef int8_t prog_int8_t;
16 | typedef uint8_t prog_uint8_t;
17 | typedef int16_t prog_int16_t;
18 | typedef uint16_t prog_uint16_t;
19 | typedef int32_t prog_int32_t;
20 | typedef uint32_t prog_uint32_t;
21 |
22 | #define memcpy_P(dest, src, num) memcpy((dest), (src), (num))
23 | #define strcpy_P(dest, src) strcpy((dest), (src))
24 | #define strcat_P(dest, src) strcat((dest), (src))
25 | #define strcmp_P(a, b) strcmp((a), (b))
26 | #define strstr_P(a, b) strstr((a), (b))
27 | #define strlen_P(a) strlen((a))
28 | #define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)
29 |
30 | #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
31 | #define pgm_read_word(addr) (*(const unsigned short *)(addr))
32 | #define pgm_read_dword(addr) (*(const unsigned long *)(addr))
33 | #define pgm_read_float(addr) (*(const float *)(addr))
34 | #define pgm_read_ptr(addr) (*(const void **)(addr))
35 |
36 | #define pgm_read_byte_near(addr) pgm_read_byte(addr)
37 | #define pgm_read_word_near(addr) pgm_read_word(addr)
38 | #define pgm_read_dword_near(addr) pgm_read_dword(addr)
39 | #define pgm_read_float_near(addr) pgm_read_float(addr)
40 | #define pgm_read_byte_far(addr) pgm_read_byte(addr)
41 | #define pgm_read_word_far(addr) pgm_read_word(addr)
42 | #define pgm_read_dword_far(addr) pgm_read_dword(addr)
43 | #define pgm_read_float_far(addr) pgm_read_float(addr)
44 | #define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/source/Marlin/src/feature/caselight.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include "../inc/MarlinConfigPre.h"
25 |
26 | #if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
27 | #include "leds/leds.h"
28 | #endif
29 |
30 | #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) || ENABLED(CASE_LIGHT_USE_NEOPIXEL)
31 | #define CASELIGHT_USES_BRIGHTNESS 1
32 | #endif
33 |
34 | class CaseLight {
35 | public:
36 | #if CASELIGHT_USES_BRIGHTNESS
37 | static uint8_t brightness;
38 | #endif
39 | static bool on;
40 |
41 | static void off();
42 | static void update(const bool sflag);
43 | static inline void update_brightness() { update(false); }
44 | static inline void update_enabled() { update(true); }
45 |
46 | private:
47 | #if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
48 | static LEDColor color;
49 | #endif
50 | };
51 |
52 | extern CaseLight caselight;
53 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/scaled_tft.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #include "../inc/MarlinConfig.h"
25 |
26 | #ifndef GRAPHICAL_TFT_UPSCALE
27 | #define GRAPHICAL_TFT_UPSCALE 2
28 | #endif
29 |
30 | #ifndef TFT_WIDTH
31 | #if GRAPHICAL_TFT_UPSCALE == 3
32 | #define TFT_WIDTH 480
33 | #else
34 | #define TFT_WIDTH 320
35 | #endif
36 | #endif
37 | #ifndef TFT_HEIGHT
38 | #if GRAPHICAL_TFT_UPSCALE == 3
39 | #define TFT_HEIGHT 320
40 | #else
41 | #define TFT_HEIGHT 240
42 | #endif
43 | #endif
44 |
45 | #ifndef TFT_PIXEL_OFFSET_X
46 | #if GRAPHICAL_TFT_UPSCALE == 2
47 | #define TFT_PIXEL_OFFSET_X 32
48 | #else
49 | #define TFT_PIXEL_OFFSET_X 48
50 | #endif
51 | #endif
52 |
53 | #ifndef TFT_PIXEL_OFFSET_Y
54 | #define TFT_PIXEL_OFFSET_Y 32 // 32 is best for both 320x240 and 480x320
55 | #endif
56 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/shared/esp_wifi.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 | #include "Delay.h"
25 |
26 | void esp_wifi_init(void) { // init ESP01 WIFI module pins
27 | #if PIN_EXISTS(ESP_WIFI_MODULE_GPIO0)
28 | OUT_WRITE(ESP_WIFI_MODULE_GPIO0_PIN, HIGH);
29 | #endif
30 | #if PIN_EXISTS(ESP_WIFI_MODULE_GPIO2)
31 | OUT_WRITE(ESP_WIFI_MODULE_GPIO2_PIN, HIGH);
32 | #endif
33 | #if PIN_EXISTS(ESP_WIFI_MODULE_RESET)
34 | delay(1); // power up delay (0.1mS minimum)
35 | OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, LOW);
36 | delay(1);
37 | OUT_WRITE(ESP_WIFI_MODULE_RESET_PIN, HIGH);
38 | #endif
39 | #if PIN_EXISTS(ESP_WIFI_MODULE_ENABLE)
40 | delay(1); // delay after reset released (0.1mS minimum)
41 | OUT_WRITE(ESP_WIFI_MODULE_ENABLE_PIN, HIGH);
42 | #endif
43 | }
44 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_13.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, Hisens thermistor
25 | const temp_entry_t temptable_13[] PROGMEM = {
26 | { OV( 20.04), 300 },
27 | { OV( 23.19), 290 },
28 | { OV( 26.71), 280 },
29 | { OV( 31.23), 270 },
30 | { OV( 36.52), 260 },
31 | { OV( 42.75), 250 },
32 | { OV( 50.68), 240 },
33 | { OV( 60.22), 230 },
34 | { OV( 72.03), 220 },
35 | { OV( 86.84), 210 },
36 | { OV(102.79), 200 },
37 | { OV(124.46), 190 },
38 | { OV(151.02), 180 },
39 | { OV(182.86), 170 },
40 | { OV(220.72), 160 },
41 | { OV(316.96), 140 },
42 | { OV(447.17), 120 },
43 | { OV(590.61), 100 },
44 | { OV(737.31), 80 },
45 | { OV(857.77), 60 },
46 | { OV(939.52), 40 },
47 | { OV(986.03), 20 },
48 | { OV(1008.7), 0 }
49 | };
50 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_332.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define OVM(V) OV((V)*(0.327/0.327))
25 |
26 | // R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor
27 | const temp_entry_t temptable_332[] PROGMEM = {
28 | { OVM( 268), 150 },
29 | { OVM( 293), 145 },
30 | { OVM( 320), 141 },
31 | { OVM( 379), 133 },
32 | { OVM( 445), 122 },
33 | { OVM( 516), 108 },
34 | { OVM( 591), 98 },
35 | { OVM( 665), 88 },
36 | { OVM( 737), 79 },
37 | { OVM( 801), 70 },
38 | { OVM( 857), 55 },
39 | { OVM( 903), 46 },
40 | { OVM( 939), 39 },
41 | { OVM( 954), 33 },
42 | { OVM( 966), 27 },
43 | { OVM( 977), 22 },
44 | { OVM( 999), 15 },
45 | { OVM(1004), 5 },
46 | { OVM(1008), 0 },
47 | { OVM(1012), -5 },
48 | { OVM(1016), -10 },
49 | { OVM(1020), -15 }
50 | };
51 |
--------------------------------------------------------------------------------
/source/framework/cores/libmaple.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * The MIT License
3 | *
4 | * Copyright (c) 2010 Perry Hung.
5 | *
6 | * Permission is hereby granted, free of charge, to any person
7 | * obtaining a copy of this software and associated documentation
8 | * files (the "Software"), to deal in the Software without
9 | * restriction, including without limitation the rights to use, copy,
10 | * modify, merge, publish, distribute, sublicense, and/or sell copies
11 | * of the Software, and to permit persons to whom the Software is
12 | * furnished to do so, subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be
15 | * included in all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | * SOFTWARE.
25 | *****************************************************************************/
26 |
27 | /**
28 | * @file libmaple/include/libmaple/libmaple.h
29 | * @brief General include file for libmaple
30 | */
31 |
32 | #ifndef _LIBMAPLE_LIBMAPLE_H_
33 | #define _LIBMAPLE_LIBMAPLE_H_
34 |
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | #include "libmaple_types.h"
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/source/Marlin/src/HAL/STM32/endstop_interrupts.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | * Copyright (c) 2017 Victor Perez
8 | *
9 | * This program is free software: you can redistribute it and/or modify
10 | * it under the terms of the GNU General Public License as published by
11 | * the Free Software Foundation, either version 3 of the License, or
12 | * (at your option) any later version.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program. If not, see .
21 | *
22 | */
23 | #pragma once
24 |
25 | #include "../../module/endstops.h"
26 |
27 | // One ISR for all EXT-Interrupts
28 | inline void endstop_ISR() { endstops.update(); }
29 |
30 | inline void setup_endstop_interrupts() {
31 | #if HAS_X_MIN
32 | attachInterrupt(X_MIN_PIN, ExtInt_X_MIN_Callback, 0, CHANGE);
33 | #endif
34 | #if HAS_Y_MIN
35 | attachInterrupt(Y_MIN_PIN, ExtInt_Y_MIN_Callback, 1, CHANGE);
36 | #endif
37 | #if HAS_Z_MIN
38 | attachInterrupt(Z_MIN_PIN, ExtInt_Z_MIN_Callback, 2, CHANGE);
39 | #endif
40 | #if HAS_Z2_MIN
41 | attachInterrupt(Z2_MIN_PIN, ExtInt_Z2_MIN_Callback, 3, CHANGE);
42 | #endif
43 | #if HAS_Z_MIN_PROBE_PIN
44 | attachInterrupt(Z_MIN_PROBE_PIN, ExtInt_Z_MIN_PROBE_Callback, 4, CHANGE);
45 | #endif
46 | }
47 |
--------------------------------------------------------------------------------
/source/Marlin/src/inc/MarlinConfig.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | //
25 | // Prefix header for all Marlin sources
26 | //
27 |
28 | #include "MarlinConfigPre.h"
29 |
30 | #ifndef __MARLIN_DEPS__
31 | #include "../HAL/HAL.h"
32 | #endif
33 |
34 | #include "../pins/pins.h"
35 |
36 | #ifndef __MARLIN_DEPS__
37 | #include HAL_PATH(../HAL, timers.h)
38 | //#include HAL_PATH(../HAL, spi_pins.h)
39 | #endif
40 |
41 | #include "Conditionals_post.h"
42 |
43 | #ifndef __MARLIN_DEPS__
44 |
45 | #include HAL_PATH(../HAL, inc/Conditionals_post.h)
46 |
47 | #include "../core/types.h" // Ahead of sanity-checks
48 |
49 | #include "SanityCheck.h"
50 | #include HAL_PATH(../HAL, inc/SanityCheck.h)
51 |
52 | // Include all core headers
53 | #include "../core/language.h"
54 | #include "../core/utility.h"
55 | #include "../core/serial.h"
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/sd/M808.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if ENABLED(GCODE_REPEAT_MARKERS)
26 |
27 | #include "../gcode.h"
28 | #include "../../feature/repeat.h"
29 |
30 | /**
31 | * M808: Set / Goto a repeat marker
32 | *
33 | * L - Set a repeat marker with 'count' repetitions. If omitted, infinity.
34 | *
35 | * Examples:
36 | *
37 | * M808 L ; Set a loop marker with a count of infinity
38 | * M808 L2 ; Set a loop marker with a count of 2
39 | * M808 ; Decrement and loop if not zero.
40 | */
41 | void GcodeSuite::M808() {
42 |
43 | // Handled early and ignored here in the queue.
44 | // Allowed to go into the queue for logging purposes.
45 |
46 | // M808 K sent from the host to cancel all loops
47 | if (parser.seen('K')) repeat.cancel();
48 |
49 | }
50 |
51 | #endif // GCODE_REPEAT_MARKERS
52 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_202.h:
--------------------------------------------------------------------------------
1 | //
2 | // Unknown 200K thermistor on a Copymaster 3D hotend
3 | // Temptable sent from dealer technologyoutlet.co.uk
4 | //
5 |
6 | const temp_entry_t temptable_202[] PROGMEM = {
7 | { OV( 1), 864 },
8 | { OV( 35), 300 },
9 | { OV( 38), 295 },
10 | { OV( 41), 290 },
11 | { OV( 44), 285 },
12 | { OV( 47), 280 },
13 | { OV( 51), 275 },
14 | { OV( 55), 270 },
15 | { OV( 60), 265 },
16 | { OV( 65), 260 },
17 | { OV( 70), 255 },
18 | { OV( 76), 250 },
19 | { OV( 83), 245 },
20 | { OV( 90), 240 },
21 | { OV( 98), 235 },
22 | { OV( 107), 230 },
23 | { OV( 116), 225 },
24 | { OV( 127), 220 },
25 | { OV( 138), 215 },
26 | { OV( 151), 210 },
27 | { OV( 164), 205 },
28 | { OV( 179), 200 },
29 | { OV( 195), 195 },
30 | { OV( 213), 190 },
31 | { OV( 232), 185 },
32 | { OV( 253), 180 },
33 | { OV( 275), 175 },
34 | { OV( 299), 170 },
35 | { OV( 325), 165 },
36 | { OV( 352), 160 },
37 | { OV( 381), 155 },
38 | { OV( 411), 150 },
39 | { OV( 443), 145 },
40 | { OV( 476), 140 },
41 | { OV( 511), 135 },
42 | { OV( 546), 130 },
43 | { OV( 581), 125 },
44 | { OV( 617), 120 },
45 | { OV( 652), 115 },
46 | { OV( 687), 110 },
47 | { OV( 720), 105 },
48 | { OV( 753), 100 },
49 | { OV( 783), 95 },
50 | { OV( 812), 90 },
51 | { OV( 839), 85 },
52 | { OV( 864), 80 },
53 | { OV( 886), 75 },
54 | { OV( 906), 70 },
55 | { OV( 924), 65 },
56 | { OV( 940), 60 },
57 | { OV( 954), 55 },
58 | { OV( 966), 50 },
59 | { OV( 976), 45 },
60 | { OV( 985), 40 },
61 | { OV( 992), 35 },
62 | { OV( 998), 30 },
63 | { OV(1003), 25 },
64 | { OV(1007), 20 },
65 | { OV(1011), 15 },
66 | { OV(1014), 10 },
67 | { OV(1016), 5 },
68 | { OV(1018), 0 }
69 | };
70 |
--------------------------------------------------------------------------------
/source/framework/cores/spi_private.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * The MIT License
3 | *
4 | * Copyright (c) 2012 LeafLabs, LLC.
5 | *
6 | * Permission is hereby granted, free of charge, to any person
7 | * obtaining a copy of this software and associated documentation
8 | * files (the "Software"), to deal in the Software without
9 | * restriction, including without limitation the rights to use, copy,
10 | * modify, merge, publish, distribute, sublicense, and/or sell copies
11 | * of the Software, and to permit persons to whom the Software is
12 | * furnished to do so, subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be
15 | * included in all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | * SOFTWARE.
25 | *****************************************************************************/
26 |
27 | #ifndef _LIBMAPLE_SPI_PRIVATE_H_
28 | #define _LIBMAPLE_SPI_PRIVATE_H_
29 |
30 | #define SPI_DEV(num) \
31 | { \
32 | .regs = SPI##num##_BASE, \
33 | .clk_id = RCC_SPI##num, \
34 | .irq_num = NVIC_SPI##num, \
35 | }
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/stepper/indirection.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | /**
24 | * stepper/indirection.cpp
25 | *
26 | * Stepper motor driver indirection to allow some stepper functions to
27 | * be done via SPI/I2c instead of direct pin manipulation.
28 | *
29 | * Copyright (c) 2015 Dominik Wenger
30 | */
31 |
32 | #include "../../inc/MarlinConfig.h"
33 | #include "indirection.h"
34 |
35 | void restore_stepper_drivers() {
36 | TERN_(HAS_TRINAMIC_CONFIG, restore_trinamic_drivers());
37 | }
38 |
39 | void reset_stepper_drivers() {
40 | #if HAS_DRIVER(TMC26X)
41 | tmc26x_init_to_defaults();
42 | #endif
43 | TERN_(HAS_L64XX, L64xxManager.init_to_defaults());
44 | TERN_(HAS_TRINAMIC_CONFIG, reset_trinamic_drivers());
45 | }
46 |
47 | #if ENABLED(SOFTWARE_DRIVER_ENABLE)
48 | // Flags to optimize XYZ Enabled state
49 | xyz_bool_t axis_sw_enabled; // = { false, false, false }
50 | #endif
51 |
--------------------------------------------------------------------------------
/source/drivers/board/board_adc.h:
--------------------------------------------------------------------------------
1 | #ifndef __BOARD_ADC_H__
2 | #define __BOARD_ADC_H__
3 |
4 |
5 | #include "hc32_common.h"
6 |
7 |
8 | #ifdef __cplusplus
9 | extern "C"{
10 | #endif
11 |
12 |
13 | #define ADC_CH 3
14 |
15 | /** ADC device type. */
16 | typedef struct adc_dev {
17 | __IO uint32_t HAL_AdcDmaIrqFlag;
18 | __IO uint16_t HAL_adc_results[ADC_CH];
19 |
20 | M4_ADC_TypeDef *regs; /**< Register map */
21 | __IO uint32_t PeriphClock; /**< clock information */
22 | __IO uint32_t Channel;
23 |
24 | M4_DMA_TypeDef* DMARegs;
25 | __IO uint32_t DMAPeriphClock;
26 | __IO uint8_t DMAChannel;
27 | __IO en_event_src_t DMAenSrc;
28 | } adc_dev;
29 | extern adc_dev adc1;
30 | extern struct adc_dev *ADC1;
31 |
32 | /********************************************************/
33 | /********************************************************/
34 | // ADC1 channel definition ch0~ch3.
35 | #define ADC1_SA_CHANNEL (ADC1_CH10|ADC1_CH11|ADC1_CH12)
36 | #define ADC1_SA_CHANNEL_COUNT (ADC_CHANNEL_COUNT)
37 | //ADC1 channel sampling time. ADC1_CH0 ADC1_CH1 ADC1_CH2
38 | /********************************************************/
39 | /********************************************************/
40 | //#define ADC1_SB_CHANNEL (ADC1_CH4|ADC1_CH5|ADC1_CH6)
41 | //#define ADC1_SB_CHANNEL_COUNT (3u)
42 | //#define ADC1_SB_CHANNEL_SAMPLE_TIME { 0x50,0x60,0x45 }
43 | /********************************************************/
44 | /********************************************************/
45 |
46 | /* ADC interrupt flag bit mask definition. */
47 | #define ADC1_SA_DMA_IRQ_BIT (1ul << 0u)
48 |
49 | extern void setup_adcs(void);
50 | extern void adc_main(void);
51 | uint16_t adc_read(adc_dev *dev, uint8_t channel);
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/tft/ui_480x320.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | #define MARLIN_LOGO_FULL_SIZE MarlinLogo480x320x16
25 |
26 | #include "ui_common.h"
27 |
28 | #define TFT_STATUS_TOP_Y 4
29 | #define TFT_TOP_LINE_Y 4
30 |
31 | #define MENU_TEXT_X_OFFSET 16
32 | #define MENU_TEXT_Y_OFFSET 7
33 |
34 | #define MENU_ITEM_ICON_X 5
35 | #define MENU_ITEM_ICON_Y 5
36 | #define MENU_ITEM_ICON_SPACE 42
37 |
38 | #if HAS_UI_480x320
39 | #define MENU_FONT_NAME Helvetica18
40 | #define SYMBOLS_FONT_NAME Helvetica18_symbols
41 | #define MENU_ITEM_HEIGHT 43
42 | #define FONT_LINE_HEIGHT 34
43 | #elif HAS_UI_480x272
44 | #define MENU_FONT_NAME Helvetica14
45 | #define SYMBOLS_FONT_NAME Helvetica14_symbols
46 | #define MENU_ITEM_HEIGHT 36
47 | #define FONT_LINE_HEIGHT 24
48 | #endif
49 | #define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2)
50 |
--------------------------------------------------------------------------------
/source/Marlin/src/module/thermistor/thermistor_3.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 | #pragma once
23 |
24 | // R25 = 100 kOhm, beta25 = 4120 K, 4.7 kOhm pull-up, mendel-parts
25 | const temp_entry_t temptable_3[] PROGMEM = {
26 | { OV( 1), 864 },
27 | { OV( 21), 300 },
28 | { OV( 25), 290 },
29 | { OV( 29), 280 },
30 | { OV( 33), 270 },
31 | { OV( 39), 260 },
32 | { OV( 46), 250 },
33 | { OV( 54), 240 },
34 | { OV( 64), 230 },
35 | { OV( 75), 220 },
36 | { OV( 90), 210 },
37 | { OV( 107), 200 },
38 | { OV( 128), 190 },
39 | { OV( 154), 180 },
40 | { OV( 184), 170 },
41 | { OV( 221), 160 },
42 | { OV( 265), 150 },
43 | { OV( 316), 140 },
44 | { OV( 375), 130 },
45 | { OV( 441), 120 },
46 | { OV( 513), 110 },
47 | { OV( 588), 100 },
48 | { OV( 734), 80 },
49 | { OV( 856), 60 },
50 | { OV( 938), 40 },
51 | { OV( 986), 20 },
52 | { OV(1008), 0 },
53 | { OV(1018), -20 }
54 | };
55 |
--------------------------------------------------------------------------------
/source/Marlin/src/sd/SdFatUtil.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | /**
24 | * sd/SdFatUtil.cpp
25 | *
26 | * Arduino SdFat Library
27 | * Copyright (c) 2008 by William Greiman
28 | *
29 | * This file is part of the Arduino Sd2Card Library
30 | */
31 |
32 | #include "../inc/MarlinConfig.h"
33 |
34 | #if ENABLED(SDSUPPORT)
35 |
36 | #include "SdFatUtil.h"
37 | #include
38 |
39 | /**
40 | * Amount of free RAM
41 | * \return The number of free bytes.
42 | */
43 | #ifdef __arm__
44 |
45 | //extern "C" char* sbrk(int incr);
46 | int SdFatUtil::FreeRam() {
47 | char top=0;
48 | //return &top - reinterpret_cast(sbrk(0));
49 | return top;
50 | }
51 |
52 | #else
53 |
54 | extern char* __brkval;
55 | extern char __bss_end;
56 | int SdFatUtil::FreeRam() {
57 | char top;
58 | return __brkval ? &top - __brkval : &top - &__bss_end;
59 | }
60 |
61 | #endif
62 |
63 | #endif // SDSUPPORT
64 |
--------------------------------------------------------------------------------
/source/board/bsp_adc.h:
--------------------------------------------------------------------------------
1 | #ifndef __BSP_ADC_H__
2 | #define __BSP_ADC_H__
3 |
4 |
5 | #include "hc32_ddl.h"
6 |
7 |
8 | #ifdef __cplusplus
9 | extern "C"
10 | {
11 | #endif
12 |
13 |
14 | #define BOARD_ADC_CH0_PORT (PortC)
15 | #define BOARD_ADC_CH0_PIN (Pin03)
16 | #define BOARD_ADC_CH0_CH (ADC1_CH13)
17 |
18 | #define BOARD_ADC_CH1_PORT (PortC)
19 | #define BOARD_ADC_CH1_PIN (Pin01)
20 | #define BOARD_ADC_CH1_CH (ADC1_CH11)
21 |
22 | #define BOARD_ADC_CH2_PORT (PortC)
23 | #define BOARD_ADC_CH2_PIN (Pin02)
24 | #define BOARD_ADC_CH2_CH (ADC1_CH12)
25 |
26 | /* Timer definition for this example. */
27 | #define TMR_UNIT (M4_TMR02)
28 |
29 |
30 | extern uint16_t AdcCH0SampleBuf[256];
31 | extern uint16_t AdcCH1SampleBuf[256];
32 | extern uint16_t AdcCH2SampleBuf[256];
33 |
34 | extern uint32_t AdcCH0Value;
35 | extern uint32_t AdcCH1Value;
36 | extern uint32_t AdcCH2Value;
37 |
38 | extern uint16_t g_adc_value[3];
39 | extern uint8_t g_adc_idx;
40 |
41 | void adc_init(void);
42 |
43 | static void adc_pin_init(void);
44 |
45 | static void AdcClockConfig(void);
46 |
47 | static void AdcInitConfig(void);
48 |
49 | static void AdcChannelConfig(void);
50 |
51 | static void AdcTriggerConfig(void);
52 |
53 |
54 | static void AdcSetChannelPinMode(const M4_ADC_TypeDef *ADCx,
55 | uint32_t u32Channel,
56 | en_pin_mode_t enMode);
57 |
58 | static void AdcSetPinMode(uint8_t u8AdcPin, en_pin_mode_t enMode);
59 |
60 | void adc_dma_config(void);
61 |
62 |
63 | void BSP_DMA2CH0_TcIrqHander(void);
64 |
65 | void BSP_DMA2CH1_TcIrqHander(void);
66 |
67 | void BSP_DMA2CH2_TcIrqHander(void);
68 |
69 |
70 | void AdcConfig(void);
71 |
72 |
73 |
74 | #ifdef __cplusplus
75 | }
76 | #endif
77 |
78 |
79 | #endif
80 |
81 |
--------------------------------------------------------------------------------
/source/Marlin/src/lcd/fontutils.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file fontutils.h
3 | * @brief help functions for font and char
4 | * @author Yunhui Fu (yhfudev@gmail.com)
5 | * @version 1.0
6 | * @date 2016-08-19
7 | * @copyright GPL/BSD
8 | */
9 | #pragma once
10 |
11 | #include
12 | #include // wchar_t
13 | #include // uint32_t
14 |
15 | #include "../HAL/shared/Marduino.h"
16 | #include "../core/macros.h"
17 |
18 | // read a byte from ROM or RAM
19 | typedef uint8_t (*read_byte_cb_t)(uint8_t * str);
20 |
21 | uint8_t read_byte_ram(uint8_t * str);
22 | uint8_t read_byte_rom(uint8_t * str);
23 |
24 | // there's overflow of the wchar_t due to the 2-byte size in Arduino
25 | // sizeof(wchar_t)=2; sizeof(size_t)=2; sizeof(uint32_t)=4;
26 | // sizeof(int)=2; sizeof(long)=4; sizeof(unsigned)=2;
27 | //#undef wchar_t
28 | #define wchar_t uint32_t
29 | //typedef uint32_t wchar_t;
30 |
31 | typedef uint16_t pixel_len_t;
32 | #define PIXEL_LEN_NOLIMIT ((pixel_len_t)(-1))
33 |
34 | /* Perform binary search */
35 | typedef int (* pf_bsearch_cb_comp_t)(void *userdata, size_t idx, void * data_pin); /*"data_list[idx] - *data_pin"*/
36 | int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, void *data_pinpoint, size_t *ret_idx);
37 |
38 | /* Get the character, decoding multibyte UTF8 characters and returning a pointer to the start of the next UTF8 character */
39 | uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t *pval);
40 |
41 | /* Returns length of string in CHARACTERS, NOT BYTES */
42 | uint8_t utf8_strlen(const char *pstart);
43 | uint8_t utf8_strlen_P(PGM_P pstart);
44 |
45 | /* Returns start byte position of desired char number */
46 | uint8_t utf8_byte_pos_by_char_num(const char *pstart, const uint8_t charnum);
47 | uint8_t utf8_byte_pos_by_char_num_P(PGM_P pstart, const uint8_t charnum);
48 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M108_M112_M410.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if DISABLED(EMERGENCY_PARSER)
26 |
27 | #include "../gcode.h"
28 | #include "../../MarlinCore.h" // for wait_for_heatup, kill, quickstop_stepper
29 |
30 | /**
31 | * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
32 | */
33 | void GcodeSuite::M108() {
34 | TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);
35 | wait_for_heatup = false;
36 | }
37 |
38 | /**
39 | * M112: Full Shutdown
40 | */
41 | void GcodeSuite::M112() {
42 | kill(M112_KILL_STR, nullptr, true);
43 | }
44 |
45 | /**
46 | * M410: Quickstop - Abort all planned moves
47 | *
48 | * This will stop the carriages mid-move, so most likely they
49 | * will be out of sync with the stepper position after this.
50 | */
51 | void GcodeSuite::M410() {
52 | quickstop_stepper();
53 | }
54 |
55 | #endif // !EMERGENCY_PARSER
56 |
--------------------------------------------------------------------------------
/source/Marlin/src/gcode/control/M280.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Marlin 3D Printer Firmware
3 | * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 | *
5 | * Based on Sprinter and grbl.
6 | * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | *
21 | */
22 |
23 | #include "../../inc/MarlinConfig.h"
24 |
25 | #if HAS_SERVOS
26 |
27 | #include "../gcode.h"
28 | #include "../../module/servo.h"
29 |
30 | /**
31 | * M280: Get or set servo position. P [S]
32 | */
33 | void GcodeSuite::M280() {
34 | if (!parser.seen('P')) return;
35 | const int servo_index = parser.value_int();
36 | if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) {
37 | if (parser.seen('S')) {
38 | const int a = parser.value_int();
39 | if (a == -1)
40 | servo[servo_index].detach();
41 | else
42 | MOVE_SERVO(servo_index, a);
43 | }
44 | else {
45 | SERIAL_ECHO_START();
46 | SERIAL_ECHOLNPAIR(" Servo ", servo_index, ": ", servo[servo_index].read());
47 | }
48 | }
49 | else {
50 | SERIAL_ERROR_START();
51 | SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range");
52 | }
53 | }
54 |
55 | #endif // HAS_SERVOS
56 |
--------------------------------------------------------------------------------