Home > other >  Questions about writing 51 SCM repository
Questions about writing 51 SCM repository

Time:10-02

Going to other people's 51 single-chip microcontroller library to write my own library, but sbit do parameter of this type, online watch and said the value assigned to a variable of type int, but how also is not successful, there are bosses know how to solve?

CodePudding user response:

Can try a bit to do parameter types

CodePudding user response:

Just contact is not very understanding, you put the key position of the code please send

CodePudding user response:

Is to write a. H file, there are two ways, 1 in the h file directly to write all the code, I like this way, the 2 c file associated to write all the code in the c file,

CodePudding user response:

reference 1st floor forget345 response:
can try a bit to do parameter type

Bit can only be one, can go into more detail about how to operate?

CodePudding user response:

Smalkang
reference 4 floor response:
Quote: refer to 1st floor forget345 response:
can try a bit to do parameter type

Bit can only be one, can go into more detail about how to operate?

You write what you want to do first, sbit is bit, a bit only what's the problem?
In my impression, only pin and useful to sbit bdata variables, is not this a bit?

CodePudding user response:

reference 5 floor forget345 reply:
Quote: refer to 4th floor smalkang response:

Quote: refer to 1st floor forget345 response:
can try a bit to do parameter type

Bit can only be one, can go into more detail about how to operate?

You write what you want to do first, sbit is bit, a bit only what's the problem?
In my impression, only pin and useful to sbit bdata variables, is not this a bit?

Write a child function
Void led (sbit p)
{}
When call directly
Sbit P=P0 ^ 0;
Leds (P);

CodePudding user response:

refer to 6th floor smalkang response:
Quote: refer to the 5 floor forget345 response:
Quote: refer to 4th floor smalkang response:

Quote: refer to 1st floor forget345 response:
can try a bit to do parameter type

Bit can only be one, can go into more detail about how to operate?

You write what you want to do first, sbit is bit, a bit only what's the problem?
In my impression, only pin and useful to sbit bdata variables, is not this a bit?

Write a child function
Void led (sbit p)
{}
When call directly
Sbit P=P0 ^ 0;
Leds (P);


Sbit P=P0 ^ 0; This writing only outside the function, which is a global variable, if it is a local variable, should write like this: - P=P0 ^ 0;
A subroutine that write the
Void led (bit) p
{}

CodePudding user response:


Still won't do

CodePudding user response:

Do you want to change the state of P1.1, with global sbit p=P1.1 is ok, and don't take p the variable name
P1.1 is global, in the header file sbit P11 P1=^ 1; You take P11 to use directly by the,

  • Related