Skip to content

Not returning value in function causes panic message #8123

@datphys

Description

@datphys

Board

Esp32 dev module

Device Description

Cusom board

Hardware Configuration

pin 27 control power key of modules sim

Version

v2.0.8

IDE Name

Arduino IDE 2.0

Operating System

Windown 10

Flash frequency

240 MHz

PSRAM enabled

no

Upload speed

115200

Description

Module reset frequenly

Sketch

//in sketch file
#include <LYNQ_L506.h>
const int pwrkey = 27;
l506_init(&Serial1, pwrkey);
l506_power_on_off();     // ----> reset here
// Replace with
digitalWrite(pwrkey, HIGH);
delay(2500);
digitalWrite(pwrkey, LOW); // ----> Working

# header file
#include <Arduino.h>
void l506_init(HardwareSerial *serial, int pin);
int8_t l506_power_on_off();

# cpp file
void l506_init(HardwareSerial *serial, int pin)
HardwareSerial *l506;
int PWRKEY;

{
    l506 = serial;
    PWRKEY = pin;
    pinMode(PWRKEY, OUTPUT);
    digitalWrite(PWRKEY, LOW);
}

int8_t l506_power_on_off()
{
    digitalWrite(PWRKEY, HIGH);
    delay(2500);
    digitalWrite(PWRKEY, LOW);
}

Debug Message

Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). Exception was unhandled.

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions