Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is makegetstatuscmd() command function? Pin
Md Mubdiul Hasan 31-Aug-21 13:48
Md Mubdiul Hasan 31-Aug-21 13:48 
GeneralRe: What is makegetstatuscmd() command function? Pin
jeron11-Sep-21 4:03
jeron11-Sep-21 4:03 
GeneralRe: What is makegetstatuscmd() command function? Pin
Md Mubdiul Hasan 1-Sep-21 16:39
Md Mubdiul Hasan 1-Sep-21 16:39 
QuestionRequirements of display filtering in power electronics data Pin
Md Mubdiul Hasan 19-Aug-21 19:42
Md Mubdiul Hasan 19-Aug-21 19:42 
AnswerRe: Requirements of display filtering in power electronics data Pin
Richard MacCutchan19-Aug-21 21:33
mveRichard MacCutchan19-Aug-21 21:33 
AnswerRe: Requirements of display filtering in power electronics data Pin
11917640 Member 22-Aug-21 4:33
11917640 Member 22-Aug-21 4:33 
GeneralRe: Requirements of display filtering in power electronics data Pin
Md Mubdiul Hasan 22-Aug-21 15:12
Md Mubdiul Hasan 22-Aug-21 15:12 
QuestionImplementing a mathematical PI control for a reasonable "if" structure Pin
Md Mubdiul Hasan 18-Aug-21 18:37
Md Mubdiul Hasan 18-Aug-21 18:37 
Hello There,

I am a newbie here. I just want to know few things those are really hard to track down. I am trying to debug a existing F/W code mostly written in c or c++. This IDE and compiler is from a particular DSP/MCU company. This code is a complex one and F/W and S/W mixed together. Some codes are not even understandable because I have very limited knowledge in syntax, pointer datatype and flags etc. Manuals and examples can give some ideas.

Now lets talk a specific problem, .c file includes some header dependencies like those are customized, made for particular reason.

#include "DSP28x_Project.h"
#include "Register.h"
#include "CLA.h"
#include "LED.h"


Mentioned register file is customized. I am not going to describe in detail. Before I post a portion of code I should explain a little. In this PI control we are trying to play with register values which may bring the channel voltage that relates with current in terms of different conditional case. Here we go,

Register[CURENT_LIMIT_STATUS] = CURRENT_LIMIT_STATUS_NULL;//need to know what is the current limit status in load
	
	if(bSysRun)// This register tells to RUN the system 
	{
		Voltage_ch1 -= Current_T_ch1 * Register[LINE_DROP_SCALE]; // multiplied by a scale vaule
		Voltage_ch1 = Voltage_ch1 < 0 ? 0 : Voltage_ch1;// less then  0, means no load

		if(Register[USE_LOADSHARE] != 0)
		{
			Voltage_ch1 -= Register[LOADSHARE_DIFF_CURRENT] * Register[LOAD_SHARE_SCALE_V];//330 no register multiplied by load share scale
			Current_BP -= Register[LOADSHARE_DIFF_CURRENT] * Register[LOAD_SHARE_SCALE_B];// BAT positive end current with same load share current

			if(Register[RUN_MODE] == MODE_SOLAR)
			{
				Voltage_ch2 += Register[LOADSHARE_DIFF_CURRENT] * Register[LOAD_SHARE_SCALE_B];//  
			}
		}
CSS



What I did not understand as follows,

1. Subtract AND assignment operator, what -= means ?
2. what += means ?
3. What does !=0 means in if structure ?
4. What double equals == means ?
AnswerRe: Implementing a mathematical PI control for a reasonable "if" structure Pin
markkuk18-Aug-21 20:18
markkuk18-Aug-21 20:18 
GeneralRe: Implementing a mathematical PI control for a reasonable "if" structure Pin
Md Mubdiul Hasan 18-Aug-21 20:46
Md Mubdiul Hasan 18-Aug-21 20:46 
AnswerRe: Implementing a mathematical PI control for a reasonable "if" structure Pin
Richard MacCutchan18-Aug-21 22:19
mveRichard MacCutchan18-Aug-21 22:19 
QuestionHandling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 4:07
ForNow30-Jul-21 4:07 
AnswerRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 4:40
Graham Breach30-Jul-21 4:40 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 5:59
ForNow30-Jul-21 5:59 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 6:29
Graham Breach30-Jul-21 6:29 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 7:23
ForNow30-Jul-21 7:23 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 8:17
Graham Breach30-Jul-21 8:17 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 8:28
ForNow30-Jul-21 8:28 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Graham Breach30-Jul-21 8:49
Graham Breach30-Jul-21 8:49 
AnswerRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Richard MacCutchan30-Jul-21 4:56
mveRichard MacCutchan30-Jul-21 4:56 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
ForNow30-Jul-21 5:11
ForNow30-Jul-21 5:11 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Richard MacCutchan30-Jul-21 5:28
mveRichard MacCutchan30-Jul-21 5:28 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Dave Kreskowiak30-Jul-21 6:10
mveDave Kreskowiak30-Jul-21 6:10 
GeneralRe: Handling KeyBoard messages/accelerators handling in MFC dialog based applications Pin
Richard MacCutchan30-Jul-21 6:15
mveRichard MacCutchan30-Jul-21 6:15 
QuestionDynamically creating CToolBar Pin
Benjamin Bruno30-Jul-21 3:54
Benjamin Bruno30-Jul-21 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.