Jump to content
    

Решено частично #define var to str

Вечер добрый.

Запутался в дефайнах.

Дефайном определено число 48 как dWorkLine .

Далее, другим дефайном хочу состряпать строку, в которую входит число 48 в виде текста.

Должно получиться так: "\e[48;1H" с возможностью менять 48 на любые другие числа.

Вызов должен быть без передачи переменных или констант в таком виде sComandLine().

#define dWorkLine  48
#define svComandLine(vROW_Z) Serial2.print("\e["#vROW_Z";1H");

В таком виде не работает:

#define sComandLine() svComandLine(dWorkLine)

 

Так работает:

#define sComandLine() svComandLine(48)

 

В общем, как заставить работать первый вариант?

 

вопрос снят

 

Заменил

#define dWorkLine  48

на

#define dWorkLine  48+6

И трындец.

Edited by Trashy_2

Share this post


Link to post
Share on other sites

В общем, как заставить работать первый вариант?

 

я полагаю так:

#define _svComandLine(vROW_Z) Serial2.print("\e["#vROW_Z";1H");
#define svComandLine(vROW_Z) _svComandLine(vROW_Z)

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...