本文整理汇总了C++中RESET函数的典型用法代码示例。如果您正苦于以下问题:C++ RESET函数的具体用法?C++ RESET怎么用?C++ RESET使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RESET函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mcp2515_bit_modify
// -------------------------------------------------------------------------
void mcp2515_bit_modify(uint8_t adress, uint8_t mask, uint8_t data)
{
RESET(MCP2515_CS);
spi_putc(SPI_BIT_MODIFY);
spi_putc(adress);
spi_putc(mask);
spi_putc(data);
SET(MCP2515_CS);
}
示例2: sja1000_read
uint8_t sja1000_read(uint8_t address)
{
uint8_t data;
// set address
SET(SJA1000_ALE);
PORT(SJA1000_DATA) = address;
_NOP();
RESET(SJA1000_ALE);
DDR(SJA1000_DATA) = 0;
// read data
RESET(SJA1000_RD);
_NOP();
data = PIN(SJA1000_DATA);
SET(SJA1000_RD);
DDR(SJA1000_DATA) = 0xff;
return data;
}
示例3: SystemException
Processor::Processor()
{
REGISTERS = gcnew array<BYTE>(7);
memory = gcnew array<BYTE>(65536);
if(!REGISTERS || !memory) {
throw gcnew SystemException("Cannot allocate memory on heap.");
}
RESET();
}
示例4: checksum
/* check the checksum */
void
checksum(void)
{
g2x();
if(cksum!=0) // if checksum does not add to zero, bad check, reset
RESET();
#if VERBOSE == 2
putch('\r'); // echo each hex record on a new line
putch('\n'); // echo each hex record on a new line
#endif
}
示例5: new
void UT_TMceStartingAnswererStreams::SetupL()
{
CMccControllerStub::OpenL();
iMcc = CMccControllerStub::Stub();
iServer = new (ELeave) CMceServerStub();
iManager = CMceMediaManager::NewL( *iServer );
iSdpDocument = CSdpDocument::DecodeL( KMceMMTestSdpAnswerAudioIMS5PrecsSendrecv );
iSession = MceMediaManagerTestHelper::CreateAudioOutSessionL();
SETUP();
RESET();
}
示例6: terminal_operation
void terminal_operation(ringbuf_t *tx, char *op0, char *op1, char *op2, char *op3) {
if (!strcmp(op0, "help") || !strcmp(op0, "?")) {
ringbuf_put_str(tx,
"\tprint_time(t)\n"
"\tadjust_time(at) [hand:y,M,d,h,m,s] [value(decimal)]\n"
"\tpwm [color:R,G,B,W] [value(%):0~100]\n"
"\tpwm clear\n"
"\tset time_sync_mode(sync)\n"
"\tset ADC_mode(adc)\n"
"\tRESET();\n"
);
}
terminal_time(tx, op0, op1, op2);
if (!strcmp(op0, "RESET();")) {
RESET();
}
if (!strcmp(op0, "bootload")) {
asm("goto 0x001C");
}
if (!strcmp(op0, "set")) {
if (!strcmp(op1, "sync")) {
light_mode = TIME_SYNC_mode;
}
if (!strcmp(op1, "adc") || !strcmp(op1, "ADC")) {
light_mode = ADC_mode;
}
}
if (!strcmp(op0, "pwm") || !strcmp(op0, "PWM")) {
if (!strcmp(op1, "r") || !strcmp(op1, "R")) {
light_mode = COMMAND_mode;
PWM_set(0, atoi(op2) * PR_VALUE / 100);
}
if (!strcmp(op1, "g") || !strcmp(op1, "G")) {
light_mode = COMMAND_mode;
PWM_set(1, atoi(op2) * PR_VALUE / 100);
}
if (!strcmp(op1, "b") || !strcmp(op1, "B")) {
light_mode = COMMAND_mode;
PWM_set(2, atoi(op2) * PR_VALUE / 100);
}
if (!strcmp(op1, "w") || !strcmp(op1, "W")) {
light_mode = COMMAND_mode;
PWM_set(3, atoi(op2) * PR_VALUE / 100);
}
if (!strcmp(op1, "clear")) {
light_mode = COMMAND_mode;
PWM_set(0, 0);
PWM_set(1, 0);
PWM_set(2, 0);
PWM_set(3, 0);
}
}
}
示例7: mcp2515_init
void mcp2515_init(void)
{
// Aktivieren der Pins fuer das SPI Interface
PORT_SPI &= ~((1 << PIN_NUM(P_SCK)) | (1 << PIN_NUM(P_MOSI)));
DDR_SPI |= (1 << PIN_NUM(P_SCK)) | (1 << PIN_NUM(P_MOSI));
SET(MCP2515_CS);
SET_OUTPUT(MCP2515_CS);
// Aktivieren des SPI Master Interfaces
SPCR = (1 << SPE) | (1 << MSTR) | R_SPCR;
SPSR = R_SPSR;
_delay_us(1);
// MCP2515 per Software Reset zuruecksetzten,
// danach ist er automatisch im Konfigurations Modus
RESET(MCP2515_CS);
spi_putc(SPI_RESET);
SET(MCP2515_CS);
// ein bisschen warten bis der MCP2515 sich neu gestartet hat
_delay_ms(0.1);
// Filter usw. setzen
RESET(MCP2515_CS);
spi_putc(SPI_WRITE);
spi_putc(RXF0SIDH);
for (uint8_t i = 0; i < sizeof(mcp2515_register_map); i++) {
spi_putc(pgm_read_byte(&mcp2515_register_map[i]));
}
SET(MCP2515_CS);
// nur Standard IDs, Message Rollover nach Puffer 1
mcp2515_write_register(RXB0CTRL, (0 << RXM1) | (1 << RXM0) | (1 << BUKT));
mcp2515_write_register(RXB1CTRL, (0 << RXM1) | (1 << RXM0));
// MCP2515 zurueck in den normalen Modus versetzten
mcp2515_write_register(CANCTRL, CLKOUT_PRESCALER_);
}
示例8: mcp2515_read_status
// ----------------------------------------------------------------------------
uint8_t mcp2515_read_status(uint8_t type)
{
uint8_t data;
RESET(MCP2515_CS);
spi_putc(type);
data = spi_putc(0xff);
SET(MCP2515_CS);
return data;
}
示例9: term_getc
// ------------------------------------------------------------------------
uint8_t term_getc()
{
uint8_t t;
// read databyte
RESET(RD);
asm ("nop");
t = PIN(USB_DATA);
SET(RD);
return t;
}
示例10: mcp2515_get_message
// ----------------------------------------------------------------------------
uint8_t mcp2515_get_message(tCAN *message)
{
// read status
uint8_t status = mcp2515_read_status(SPI_RX_STATUS);
uint8_t addr;
uint8_t t;
if (bit_is_set(status,6)) {
// message in buffer 0
addr = SPI_READ_RX;
}
else if (bit_is_set(status,7)) {
// message in buffer 1
addr = SPI_READ_RX | 0x04;
}
else {
// Error: no message available
return 0;
}
RESET(MCP2515_CS);
spi_putc(addr);
// read id
message->id = (uint16_t) spi_putc(0xff) << 3;
message->id |= spi_putc(0xff) >> 5;
spi_putc(0xff);
spi_putc(0xff);
// read DLC
uint8_t length = spi_putc(0xff) & 0x0f;
message->header.length = length;
message->header.rtr = (bit_is_set(status, 3)) ? 1 : 0;
// read data
for (t=0;t<length;t++) {
message->data[t] = spi_putc(0xff);
}
SET(MCP2515_CS);
// clear interrupt flag
if (bit_is_set(status, 6)) {
mcp2515_bit_modify(CANINTF, (1<<RX0IF), 0);
}
else {
mcp2515_bit_modify(CANINTF, (1<<RX1IF), 0);
}
return (status & 0x07) + 1;
}
示例11: SET
// write either command or data, with automatic 4/8-bit selection
void LiquidCrystal::send(unsigned char value, bool mode) {
if (this->realTimeDisplay) {
if (mode) {
SET(_rs_pin);
} else {
RESET(_rs_pin);
}
write4bits(value >> 4);
pulseEnable(1);
write4bits(value);
pulseEnable(delayAfterCommand);
} else {
if (!lcdActions.isFull()) {
示例12: proc_activesource_read
int proc_activesource_read(char *page, char **start, off_t off, int count, int *eof, void *data_unused)
{
unsigned short physAddr = 0;
PR_INIT();
physAddr = getActiveSource();
len = sprintf(page, "%01x.%01x.%01x.%01x\n", (physAddr >> 12) & 0xf, (physAddr >> 8) & 0xf,
(physAddr >> 4) & 0xf, (physAddr >> 0) & 0xf);
RESET(eventActiveSource);
PR_EXIT(len)
}
示例13: ft_strcmp
int ft_strcmp(const char *s1, const char *s2)
{
int a;
int b;
if (s1 == NULL)
return (0);
RESET(a, b);
while (s1[a] == s2[a] && s1[a] && s2[a])
{
a++;
}
b = s1[a] - s2[a];
return (b);
}
示例14: mcp2515_read_register
// -------------------------------------------------------------------------
uint8_t mcp2515_read_register(uint8_t adress)
{
uint8_t data;
RESET(MCP2515_CS);
spi_putc(SPI_READ);
spi_putc(adress);
data = spi_putc(0xff);
SET(MCP2515_CS);
return data;
}
示例15: RESET
//reset all the ADS1299's settings. Call however you'd like. Stops all data acquisition
void ADS1299::resetADS(void)
{
RESET(); // send RESET command to default all registers
SDATAC(); // exit Read Data Continuous mode to communicate with ADS
delay(100);
// turn off all channels
for (int chan=1; chan <= 8; chan++) {
deactivateChannel(chan);
}
setSRB1(use_SRB1()); //set whether SRB1 is active or not
};