Advertisement
Guest User

Arexlookhere

a guest
Feb 25th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.92 KB | None | 0 0
  1. /*
  2. This file is part of Repetier-Firmware.
  3.  
  4. Repetier-Firmware is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8.  
  9. Repetier-Firmware 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. See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with Repetier-Firmware. If not, see <http://www.gnu.org/licenses/>.
  16.  
  17. This firmware is a nearly complete rewrite of the sprinter firmware
  18. by kliment (https://github.com/kliment/Sprinter)
  19. which based on Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
  20. */
  21.  
  22. #ifndef COMMUNICATION_H
  23. #define COMMUNICATION_H
  24.  
  25. class Com
  26. {
  27. public:
  28. FSTRINGVAR(tDebug)
  29. FSTRINGVAR(tFirmware)
  30. FSTRINGVAR(tOk)
  31. FSTRINGVAR(tNewline)
  32. FSTRINGVAR(tNAN)
  33. FSTRINGVAR(tINF)
  34. FSTRINGVAR(tError)
  35. FSTRINGVAR(tInfo)
  36. FSTRINGVAR(tWarning)
  37. FSTRINGVAR(tResend)
  38. FSTRINGVAR(tEcho)
  39. FSTRINGVAR(tCap)
  40. FSTRINGVAR(tOkSpace)
  41. FSTRINGVAR(tWrongChecksum)
  42. FSTRINGVAR(tMissingChecksum)
  43. FSTRINGVAR(tFormatError)
  44. FSTRINGVAR(tDonePrinting)
  45. FSTRINGVAR(tX)
  46. FSTRINGVAR(tY)
  47. FSTRINGVAR(tZ)
  48. FSTRINGVAR(tE)
  49. FSTRINGVAR(tF)
  50. FSTRINGVAR(tS)
  51. FSTRINGVAR(tP)
  52. FSTRINGVAR(tI)
  53. FSTRINGVAR(tJ)
  54. FSTRINGVAR(tR)
  55. FSTRINGVAR(tSDReadError)
  56. FSTRINGVAR(tExpectedLine)
  57. FSTRINGVAR(tGot)
  58. FSTRINGVAR(tSkip)
  59. FSTRINGVAR(tBLK)
  60. FSTRINGVAR(tStart)
  61. FSTRINGVAR(tPowerUp)
  62. FSTRINGVAR(tExternalReset)
  63. FSTRINGVAR(tBrownOut)
  64. FSTRINGVAR(tWatchdog)
  65. FSTRINGVAR(tSoftwareReset)
  66. FSTRINGVAR(tUnknownCommand)
  67. FSTRINGVAR(tFreeRAM)
  68. FSTRINGVAR(tXColon)
  69. FSTRINGVAR(tSlash)
  70. FSTRINGVAR(tSpaceSlash)
  71. FSTRINGVAR(tFatal)
  72. #if JSON_OUTPUT
  73. FSTRINGVAR(tJSONDir)
  74. FSTRINGVAR(tJSONFiles)
  75. FSTRINGVAR(tJSONArrayEnd)
  76. FSTRINGVAR(tJSONErrorStart)
  77. FSTRINGVAR(tJSONErrorEnd)
  78. FSTRINGVAR(tJSONFileInfoStart)
  79. FSTRINGVAR(tJSONFileInfoHeight)
  80. FSTRINGVAR(tJSONFileInfoLayerHeight)
  81. FSTRINGVAR(tJSONFileInfoFilament)
  82. FSTRINGVAR(tJSONFileInfoGeneratedBy)
  83. FSTRINGVAR(tJSONFileInfoName)
  84. #endif
  85. FSTRINGVAR(tSpaceXColon)
  86. FSTRINGVAR(tSpaceYColon)
  87. FSTRINGVAR(tSpaceZColon)
  88. FSTRINGVAR(tSpaceEColon)
  89. FSTRINGVAR(tTColon)
  90. FSTRINGVAR(tSpaceBColon)
  91. FSTRINGVAR(tSpaceAtColon)
  92. FSTRINGVAR(tSpaceT)
  93. FSTRINGVAR(tSpaceRaw)
  94. FSTRINGVAR(tSpaceAt)
  95. FSTRINGVAR(tSpaceBAtColon)
  96. FSTRINGVAR(tColon)
  97. FSTRINGVAR(tSpeedMultiply)
  98. FSTRINGVAR(tFlowMultiply)
  99. FSTRINGVAR(tFanspeed)
  100. FSTRINGVAR(tFan2speed)
  101. FSTRINGVAR(tPrintedFilament)
  102. FSTRINGVAR(tPrintingTime)
  103. FSTRINGVAR(tSpacem)
  104. FSTRINGVAR(tSpaceDaysSpace)
  105. FSTRINGVAR(tSpaceHoursSpace)
  106. FSTRINGVAR(tSpaceMin)
  107. FSTRINGVAR(tInvalidArc)
  108. FSTRINGVAR(tComma)
  109. FSTRINGVAR(tSpace)
  110. FSTRINGVAR(tYColon)
  111. FSTRINGVAR(tZColon)
  112. FSTRINGVAR(tE0Colon)
  113. FSTRINGVAR(tE1Colon)
  114. FSTRINGVAR(tMS1MS2Pins)
  115. FSTRINGVAR(tSetOutputSpace)
  116. FSTRINGVAR(tGetInputSpace)
  117. FSTRINGVAR(tSpaceToSpace)
  118. FSTRINGVAR(tSpaceIsSpace)
  119. FSTRINGVAR(tHSpace)
  120. FSTRINGVAR(tLSpace)
  121. FSTRINGVAR(tXMinColon)
  122. FSTRINGVAR(tXMaxColon)
  123. FSTRINGVAR(tYMinColon)
  124. FSTRINGVAR(tYMaxColon)
  125. FSTRINGVAR(tZMinColon)
  126. FSTRINGVAR(tZ2MinMaxColon)
  127. FSTRINGVAR(tZMaxColon)
  128. FSTRINGVAR(tJerkColon)
  129. FSTRINGVAR(tZJerkColon)
  130. FSTRINGVAR(tLinearStepsColon)
  131. FSTRINGVAR(tQuadraticStepsColon)
  132. FSTRINGVAR(tCommaSpeedEqual)
  133. FSTRINGVAR(tLinearLColon)
  134. FSTRINGVAR(tQuadraticKColon)
  135. FSTRINGVAR(tEEPROMUpdated)
  136. FSTRINGVAR(tFilamentSlipping)
  137. FSTRINGVAR(tPauseCommunication)
  138. FSTRINGVAR(tContinueCommunication)
  139. #if NONLINEAR_SYSTEM
  140. FSTRINGVAR(tInvalidDeltaCoordinate)
  141. FSTRINGVAR(tDBGDeltaNoMoveinDSegment)
  142. #endif
  143. #if DRIVE_SYSTEM == DELTA
  144. FSTRINGVAR(tMeasurementReset)
  145. FSTRINGVAR(tMeasureDeltaSteps)
  146. FSTRINGVAR(tMeasureDelta)
  147. FSTRINGVAR(tMeasureOriginReset)
  148. FSTRINGVAR(tMeasurementAbortedOrigin)
  149. FSTRINGVAR(tLevelingCalc)
  150. FSTRINGVAR(tTower1)
  151. FSTRINGVAR(tTower2)
  152. FSTRINGVAR(tTower3)
  153. FSTRINGVAR(tDeltaAlphaA)
  154. FSTRINGVAR(tDeltaAlphaB)
  155. FSTRINGVAR(tDeltaAlphaC)
  156. FSTRINGVAR(tDeltaRadiusCorrectionA)
  157. FSTRINGVAR(tDeltaRadiusCorrectionB)
  158. FSTRINGVAR(tDeltaRadiusCorrectionC)
  159. FSTRINGVAR(tDeltaDiagonalCorrectionA)
  160. FSTRINGVAR(tDeltaDiagonalCorrectionB)
  161. FSTRINGVAR(tDeltaDiagonalCorrectionC)
  162. FSTRINGVAR(tEPRDeltaMaxRadius)
  163. #endif // DRIVE_SYSTEM
  164. #if DRIVE_SYSTEM==TUGA
  165. FSTRINGVAR(tEPRDiagonalRodLength)
  166. #endif
  167. #ifdef DEBUG_GENERIC
  168. FSTRINGVAR(tGenTemp)
  169. #endif // DEBUG_GENERICFSTRINGVALUE(Com::,"")
  170. FSTRINGVAR(tTargetExtr)
  171. FSTRINGVAR(tTargetBedColon)
  172. FSTRINGVAR(tPIDAutotuneStart)
  173. FSTRINGVAR(tAPIDBias)
  174. FSTRINGVAR(tAPIDD)
  175. FSTRINGVAR(tAPIDMin)
  176. FSTRINGVAR(tAPIDMax)
  177. FSTRINGVAR(tAPIDKu)
  178. FSTRINGVAR(tAPIDTu)
  179. FSTRINGVAR(tAPIDClassic)
  180. FSTRINGVAR(tAPIDKp)
  181. FSTRINGVAR(tAPIDKi)
  182. FSTRINGVAR(tAPIDKd)
  183. FSTRINGVAR(tAPIDFailedHigh)
  184. FSTRINGVAR(tAPIDFailedTimeout)
  185. FSTRINGVAR(tAPIDFinished)
  186. FSTRINGVAR(tMTEMPColon)
  187. FSTRINGVAR(tHeatedBed)
  188. FSTRINGVAR(tExtruderSpace)
  189. FSTRINGVAR(tTempSensorDefect)
  190. FSTRINGVAR(tTempSensorWorking)
  191. FSTRINGVAR(tDryModeUntilRestart)
  192. #ifdef DEBUG_QUEUE_MOVE
  193. FSTRINGVAR(tDBGId)
  194. FSTRINGVAR(tDBGVStartEnd)
  195. FSTRINGVAR(tDBAccelSteps)
  196. FSTRINGVAR(tDBGStartEndSpeed)
  197. FSTRINGVAR(tDBGFlags)
  198. FSTRINGVAR(tDBGJoinFlags)
  199. FSTRINGVAR(tDBGDelta)
  200. FSTRINGVAR(tDBGDir)
  201. FSTRINGVAR(tDBGFullSpeed)
  202. FSTRINGVAR(tDBGVMax)
  203. FSTRINGVAR(tDBGAcceleration)
  204. FSTRINGVAR(tDBGAccelerationPrim)
  205. FSTRINGVAR(tDBGRemainingSteps)
  206. FSTRINGVAR(tDBGAdvanceFull)
  207. FSTRINGVAR(tDBGAdvanceRate)
  208. FSTRINGVAR(tDBGLimitInterval)
  209. FSTRINGVAR(tDBGMoveDistance)
  210. FSTRINGVAR(tDBGCommandedFeedrate)
  211. FSTRINGVAR(tDBGConstFullSpeedMoveTime)
  212. #endif // DEBUG_QUEUE_MOVEFSTRINGVALUE(Com::,"")
  213. #ifdef DEBUG_DELTA_OVERFLOW
  214. FSTRINGVAR(tDBGDeltaOverflow)
  215. #endif // DEBUG_DELTA_OVERFLOW
  216. #ifdef DEBUG_SPLIT
  217. FSTRINGVAR(tDBGDeltaSeconds)
  218. FSTRINGVAR(tDBGDeltaZDelta)
  219. FSTRINGVAR(tDBGDeltaSegments)
  220. FSTRINGVAR(tDBGDeltaNumLines)
  221. FSTRINGVAR(tDBGDeltaSegmentsPerLine)
  222. FSTRINGVAR(tDBGDeltaMaxDS)
  223. FSTRINGVAR(tDBGDeltaStepsPerSegment)
  224. FSTRINGVAR(tDBGDeltaVirtualAxisSteps)
  225. #endif
  226. #ifdef DEBUG_STEPCOUNT
  227. FSTRINGVAR(tDBGMissedSteps)
  228. #endif
  229. #if FEATURE_Z_PROBE
  230. FSTRINGVAR(tZProbe)
  231. FSTRINGVAR(tZProbeState)
  232. FSTRINGVAR(tZProbeStartScript)
  233. FSTRINGVAR(tZProbeEndScript)
  234. FSTRINGVAR(tHitZProbe)
  235. FSTRINGVAR(tZProbeAverage)
  236. FSTRINGVAR(tZProbeZReset)
  237. FSTRINGVAR(tZProbeBedDitance)
  238. #endif
  239. FSTRINGVAR(tAutolevelReset)
  240. FSTRINGVAR(tAutolevelEnabled)
  241. FSTRINGVAR(tAutolevelDisabled)
  242. FSTRINGVAR(tTransformationMatrix)
  243. FSTRINGVAR(tZProbeFailed)
  244. FSTRINGVAR(tZProbeMax)
  245. FSTRINGVAR(tZProbePrinterHeight)
  246.  
  247. #ifdef WAITING_IDENTIFIER
  248. FSTRINGVAR(tWait)
  249. #endif // WAITING_IDENTIFIER
  250.  
  251. #if EEPROM_MODE==0
  252. FSTRINGVAR(tNoEEPROMSupport)
  253. #else
  254. FSTRINGVAR(tZProbeOffsetZ)
  255. #if FEATURE_Z_PROBE
  256. FSTRINGVAR(tZProbeHeight)
  257. FSTRINGVAR(tZProbeOffsetX)
  258. FSTRINGVAR(tZProbeOffsetY)
  259. FSTRINGVAR(tZProbeSpeed)
  260. FSTRINGVAR(tZProbeSpeedXY)
  261. FSTRINGVAR(tZProbeX1)
  262. FSTRINGVAR(tZProbeY1)
  263. FSTRINGVAR(tZProbeX2)
  264. FSTRINGVAR(tZProbeY2)
  265. FSTRINGVAR(tZProbeX3)
  266. FSTRINGVAR(tZProbeY3)
  267. FSTRINGVAR(zZProbeBendingCorA)
  268. FSTRINGVAR(zZProbeBendingCorB)
  269. FSTRINGVAR(zZProbeBendingCorC)
  270. #endif
  271. #if FEATURE_AUTOLEVEL
  272. FSTRINGVAR(tAutolevelActive)
  273. #endif
  274. #if FEATURE_AXISCOMP
  275. FSTRINGVAR(tAxisCompTanXY)
  276. FSTRINGVAR(tAxisCompTanYZ)
  277. FSTRINGVAR(tAxisCompTanXZ)
  278. #endif
  279. FSTRINGVAR(tConfigStoredEEPROM)
  280. FSTRINGVAR(tConfigLoadedEEPROM)
  281. FSTRINGVAR(tEPRConfigResetDefaults)
  282. FSTRINGVAR(tEPRProtocolChanged)
  283. FSTRINGVAR(tEPR0)
  284. FSTRINGVAR(tEPR1)
  285. FSTRINGVAR(tEPR2)
  286. FSTRINGVAR(tEPR3)
  287. FSTRINGVAR(tLanguage)
  288. FSTRINGVAR(tEPRBaudrate)
  289. FSTRINGVAR(tEPRFilamentPrinted)
  290. FSTRINGVAR(tEPRPrinterActive)
  291. FSTRINGVAR(tEPRMaxInactiveTime)
  292. FSTRINGVAR(tEPRStopAfterInactivty)
  293. FSTRINGVAR(tEPRMaxJerk)
  294. FSTRINGVAR(tEPRXHomePos)
  295. FSTRINGVAR(tEPRYHomePos)
  296. FSTRINGVAR(tEPRZHomePos)
  297. FSTRINGVAR(tEPRXMaxLength)
  298. FSTRINGVAR(tEPRYMaxLength)
  299. FSTRINGVAR(tEPRZMaxLength)
  300. FSTRINGVAR(tEPRXBacklash)
  301. FSTRINGVAR(tEPRYBacklash)
  302. FSTRINGVAR(tEPRZBacklash)
  303. FSTRINGVAR(tEPRZAcceleration)
  304. FSTRINGVAR(tEPRZTravelAcceleration)
  305. FSTRINGVAR(tEPRAccelerationFactorAtTop)
  306. FSTRINGVAR(tEPRZStepsPerMM)
  307. FSTRINGVAR(tEPRZMaxFeedrate)
  308. FSTRINGVAR(tEPRZHomingFeedrate)
  309. #if DRIVE_SYSTEM != DELTA
  310. FSTRINGVAR(tEPRMaxZJerk)
  311. FSTRINGVAR(tEPRXStepsPerMM)
  312. FSTRINGVAR(tEPRYStepsPerMM)
  313. FSTRINGVAR(tEPRXMaxFeedrate)
  314. FSTRINGVAR(tEPRYMaxFeedrate)
  315. FSTRINGVAR(tEPRXHomingFeedrate)
  316. FSTRINGVAR(tEPRYHomingFeedrate)
  317. FSTRINGVAR(tEPRXAcceleration)
  318. FSTRINGVAR(tEPRYAcceleration)
  319. FSTRINGVAR(tEPRXTravelAcceleration)
  320. FSTRINGVAR(tEPRYTravelAcceleration)
  321. #else
  322. FSTRINGVAR(tEPRDiagonalRodLength)
  323. FSTRINGVAR(tEPRHorizontalRadius)
  324. FSTRINGVAR(tEPRTowerXOffset)
  325. FSTRINGVAR(tEPRTowerYOffset)
  326. FSTRINGVAR(tEPRTowerZOffset)
  327. #endif
  328. FSTRINGVAR(tEPROPSMode)
  329. FSTRINGVAR(tEPROPSMoveAfter)
  330. FSTRINGVAR(tEPROPSMinDistance)
  331. FSTRINGVAR(tEPROPSRetractionLength)
  332. FSTRINGVAR(tEPROPSRetractionBacklash)
  333. FSTRINGVAR(tEPRBedHeatManager)
  334. FSTRINGVAR(tEPRBedPIDDriveMax)
  335. FSTRINGVAR(tEPRBedPIDDriveMin)
  336. FSTRINGVAR(tEPRBedPGain)
  337. FSTRINGVAR(tEPRBedIGain)
  338. FSTRINGVAR(tEPRBedDGain)
  339. FSTRINGVAR(tEPRBedPISMaxValue)
  340. FSTRINGVAR(tEPRStepsPerMM)
  341. FSTRINGVAR(tEPRMaxFeedrate)
  342. FSTRINGVAR(tEPRStartFeedrate)
  343. FSTRINGVAR(tEPRAcceleration)
  344. FSTRINGVAR(tEPRHeatManager)
  345. FSTRINGVAR(tEPRDriveMax)
  346. FSTRINGVAR(tEPRDriveMin)
  347. FSTRINGVAR(tEPRPGain)
  348. FSTRINGVAR(tEPRDead)
  349. FSTRINGVAR(tEPRUnused)
  350. FSTRINGVAR(tEPRIGain)
  351. FSTRINGVAR(tEPRDGain)
  352. FSTRINGVAR(tEPRPIDMaxValue)
  353. FSTRINGVAR(tEPRXOffset)
  354. FSTRINGVAR(tEPRYOffset)
  355. FSTRINGVAR(tEPRZOffset)
  356. FSTRINGVAR(tEPRStabilizeTime)
  357. FSTRINGVAR(tEPRRetractionWhenHeating)
  358. FSTRINGVAR(tEPRDistanceRetractHeating)
  359. FSTRINGVAR(tEPRExtruderCoolerSpeed)
  360. FSTRINGVAR(tEPRAdvanceK)
  361. FSTRINGVAR(tEPRAdvanceL)
  362. #endif
  363. #if SDSUPPORT
  364. //FSTRINGVAR(tSDRemoved)
  365. //FSTRINGVAR(tSDInserted)
  366. FSTRINGVAR(tSDInitFail)
  367. FSTRINGVAR(tErrorWritingToFile)
  368. FSTRINGVAR(tBeginFileList)
  369. FSTRINGVAR(tEndFileList)
  370. FSTRINGVAR(tFileOpened)
  371. FSTRINGVAR(tSpaceSizeColon)
  372. FSTRINGVAR(tFileSelected)
  373. FSTRINGVAR(tFileOpenFailed)
  374. FSTRINGVAR(tSDPrintingByte)
  375. FSTRINGVAR(tNotSDPrinting)
  376. FSTRINGVAR(tOpenFailedFile)
  377. FSTRINGVAR(tWritingToFile)
  378. FSTRINGVAR(tDoneSavingFile)
  379. FSTRINGVAR(tFileDeleted)
  380. FSTRINGVAR(tDeletionFailed)
  381. FSTRINGVAR(tDirectoryCreated)
  382. FSTRINGVAR(tCreationFailed)
  383. FSTRINGVAR(tSDErrorCode)
  384. #endif // SDSUPPORT
  385. FSTRINGVAR(tHeaterDecoupled)
  386. FSTRINGVAR(tHeaterDecoupledWarning)
  387. #if DISTORTION_CORRECTION
  388. FSTRINGVAR(tZCorrectionEnabled)
  389. FSTRINGVAR(tZCorrectionDisabled)
  390. #endif
  391. #if FEATURE_RETRACTION
  392. FSTRINGVAR(tEPRAutoretractEnabled)
  393. FSTRINGVAR(tEPRRetractionLength)
  394. FSTRINGVAR(tEPRRetractionLongLength)
  395. FSTRINGVAR(tEPRRetractionSpeed)
  396. FSTRINGVAR(tEPRRetractionZLift)
  397. FSTRINGVAR(tEPRRetractionUndoExtraLength)
  398. FSTRINGVAR(tEPRRetractionUndoExtraLongLength)
  399. FSTRINGVAR(tEPRRetractionUndoSpeed)
  400. #endif
  401. FSTRINGVAR(tConfig)
  402. FSTRINGVAR(tExtrDot)
  403.  
  404. #if STEPPER_CURRENT_CONTROL == CURRENT_CONTROL_MCP4728
  405. FSTRINGVAR(tMCPEpromSettings)
  406. FSTRINGVAR(tMCPCurrentSettings)
  407. #endif
  408. FSTRINGVAR(tPrinterModeFFF)
  409. FSTRINGVAR(tPrinterModeLaser)
  410. FSTRINGVAR(tPrinterModeCNC)
  411. #ifdef STARTUP_GCODE
  412. FSTRINGVAR(tStartupGCode)
  413. #endif
  414. #if NONLINEAR_SYSTEM
  415. FSTRINGVAR(tEPRSegmentsPerSecondPrint)
  416. FSTRINGVAR(tEPRSegmentsPerSecondTravel)
  417. #endif
  418.  
  419. static void cap(FSTRINGPARAM(text));
  420. static void config(FSTRINGPARAM(text));
  421. static void config(FSTRINGPARAM(text),int value);
  422. static void config(FSTRINGPARAM(text),const char *msg);
  423. static void config(FSTRINGPARAM(text),int32_t value);
  424. static void config(FSTRINGPARAM(text),uint32_t value);
  425. static void config(FSTRINGPARAM(text),float value,uint8_t digits=2);
  426. static void printNumber(uint32_t n);
  427. static void printWarningF(FSTRINGPARAM(text));
  428. static void printInfoF(FSTRINGPARAM(text));
  429. static void printErrorF(FSTRINGPARAM(text));
  430. static void printWarningFLN(FSTRINGPARAM(text));
  431. static void printInfoFLN(FSTRINGPARAM(text));
  432. static void printErrorFLN(FSTRINGPARAM(text));
  433. static void printFLN(FSTRINGPARAM(text));
  434. static void printF(FSTRINGPARAM(text));
  435. static void printF(FSTRINGPARAM(text),int value);
  436. static void printF(FSTRINGPARAM(text),const char *msg);
  437. static void printF(FSTRINGPARAM(text),int32_t value);
  438. static void printF(FSTRINGPARAM(text),uint32_t value);
  439. static void printF(FSTRINGPARAM(text),float value,uint8_t digits=2);
  440. static void printFLN(FSTRINGPARAM(text),int value);
  441. static void printFLN(FSTRINGPARAM(text),int32_t value);
  442. static void printFLN(FSTRINGPARAM(text),uint32_t value);
  443. static void printFLN(FSTRINGPARAM(text),const char *msg);
  444. static void printFLN(FSTRINGPARAM(text),float value,uint8_t digits=2);
  445. static void printArrayFLN(FSTRINGPARAM(text),float *arr,uint8_t n=4,uint8_t digits=2);
  446. static void printArrayFLN(FSTRINGPARAM(text),long *arr,uint8_t n=4);
  447. static void print(long value);
  448. static inline void print(uint32_t value) {printNumber(value);}
  449. static inline void print(int value) {print((int32_t)value);}
  450. static void print(const char *text);
  451. static inline void print(char c) {HAL::serialWriteByte(c);}
  452. static void printFloat(float number, uint8_t digits);
  453. static inline void print(float number) {printFloat(number, 6);}
  454. static inline void println() {HAL::serialWriteByte('\r');HAL::serialWriteByte('\n');}
  455. #if UI_DISPLAY_TYPE != NO_DISPLAY
  456. static const char* translatedF(int textId);
  457. static void selectLanguage(fast8_t lang);
  458. static uint8_t selectedLanguage;
  459. #endif
  460. protected:
  461. private:
  462. };
  463.  
  464. #ifdef DEBUG
  465. #define SHOW(x) {Com::printF(PSTR(" " #x "=")); Com::print(x); Com::println();}
  466. #define SHOWS(x) {Com::printF(PSTR(" " #x "=")); Com::print(x); Com::print(" steps "); Com::print(x/80); Com::printFLN(PSTR(" mm"));}
  467. #define SHOWM(x) {Com::printF(PSTR(" " #x "=")); Com::print((long)x*80); Com::print(" steps "); Com::print(x); Com::printFLN(PSTR(" mm"));}
  468. #define SHOT(x) Com::printF(PSTR(x " "))
  469. #define SHOWA(t,a,n) {SHOT(t); for (int i=0;i<n;i++) SHOWS(a[i]);}
  470. #define SHOWAM(t,a,n) {SHOT(t); for (int i=0;i<n;i++) SHOWM(a[i]);}
  471.  
  472. #else
  473. #define SHOW(x)
  474. #define SHOT(x)
  475. #define SHOWS(x)
  476. #define SHOWM(x)
  477. #define SHOWA(t,a,n)
  478. #define SHOWAM(t,a,n)
  479. #endif
  480.  
  481. #endif // COMMUNICATION_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement